<?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=Hhleroy</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=Hhleroy"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Hhleroy"/>
	<updated>2026-05-13T16:39:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133903</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133903"/>
		<updated>2020-04-24T18:33:12Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be implemented:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good reference for completion of this project's requirements. This build has already implemented necessary functionality that helps track of time spent viewing external pages.  The code also has an existing user-friendly UI.  The reason it was not integrated into expertiza was due to large amounts of white space in files, confusing commit history, and complicated merge of E1791's code, who's repository fork is no longer existing. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], many changes needed to be manually implemented using a new commit history. We were able to add the following functionality, while reducing project size from 5000 line changes to less than 1000 line changes:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''UI Changes''' ==&lt;br /&gt;
The following section shows various alterations to the Expertiza user interface in order to display information about time spent on a given review. Additionally, some alterations were made to the student's user interface to assist them in their review.&lt;br /&gt;
&lt;br /&gt;
* Added time value to the table on &amp;quot;Review Reports&amp;quot; page. Found in &amp;quot;Team Reviewed&amp;quot; column of the table&lt;br /&gt;
&lt;br /&gt;
* Added a pie chart to show breakdown of where time was spent during the review.&lt;br /&gt;
[[File:Pie_chart.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
* Added a timeout reminder that asks the student if they are still performing the review after 5 minutes of the computer idling.&lt;br /&gt;
[[File:Popup.PNG|center|Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133901</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133901"/>
		<updated>2020-04-24T18:32:44Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be implemented:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good reference for completion of this project's requirements. This build has already implemented necessary functionality that helps track of time spent viewing external pages.  The code also has an existing user-friendly UI.  The reason it was not integrated into expertiza was due to large amounts of white space in files, confusing commit history, and complicated merge of E1791's code, who's repository fork is no longer existing. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], many changes needed to be manually implemented using a new commit history. We were able to add the existing functionality, while reducing project size from 5000 code changes to less than 1000 lines.  &lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''UI Changes''' ==&lt;br /&gt;
The following section shows various alterations to the Expertiza user interface in order to display information about time spent on a given review. Additionally, some alterations were made to the student's user interface to assist them in their review.&lt;br /&gt;
&lt;br /&gt;
* Added time value to the table on &amp;quot;Review Reports&amp;quot; page. Found in &amp;quot;Team Reviewed&amp;quot; column of the table&lt;br /&gt;
&lt;br /&gt;
* Added a pie chart to show breakdown of where time was spent during the review.&lt;br /&gt;
[[File:Pie_chart.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
* Added a timeout reminder that asks the student if they are still performing the review after 5 minutes of the computer idling.&lt;br /&gt;
[[File:Popup.png|center|Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Popup.PNG&amp;diff=133899</id>
		<title>File:Popup.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Popup.PNG&amp;diff=133899"/>
		<updated>2020-04-24T18:32:05Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133895</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133895"/>
		<updated>2020-04-24T18:31:04Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be implemented:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good reference for completion of this project's requirements. This build has already implemented necessary functionality that helps track time spent viewing external pages.  The reason it was not integrated into expertiza was due to large amounts of white space in files, confusing commit history, and complicated merge of E1791's code. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], many changes needed to be manually implemented using a new commit history. We were able to add the existing functionality, while reducing project size from 5000 code changes to less than 1000 lines.  &lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''UI Changes''' ==&lt;br /&gt;
The following section shows various alterations to the Expertiza user interface in order to display information about time spent on a given review. Additionally, some alterations were made to the student's user interface to assist them in their review.&lt;br /&gt;
&lt;br /&gt;
* Added time value to the table on &amp;quot;Review Reports&amp;quot; page. Found in &amp;quot;Team Reviewed&amp;quot; column of the table&lt;br /&gt;
&lt;br /&gt;
* Added a pie chart to show breakdown of where time was spent during the review.&lt;br /&gt;
[[File:Pie_chart.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
* Added a timeout reminder that asks the student if they are still performing the review after 5 minutes of the computer idling.&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133893</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133893"/>
		<updated>2020-04-24T18:30:40Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be implemented:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits, confusing commit history, and complicated merge of E1791's code. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be manually implemented:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''UI Changes''' ==&lt;br /&gt;
The following section shows various alterations to the Expertiza user interface in order to display information about time spent on a given review. Additionally, some alterations were made to the student's user interface to assist them in their review.&lt;br /&gt;
&lt;br /&gt;
* Added time value to the table on &amp;quot;Review Reports&amp;quot; page. Found in &amp;quot;Team Reviewed&amp;quot; column of the table&lt;br /&gt;
&lt;br /&gt;
* Added a pie chart to show breakdown of where time was spent during the review.&lt;br /&gt;
[[File:Pie_chart.png]]&lt;br /&gt;
&lt;br /&gt;
* Added a timeout reminder that asks the student if they are still performing the review after 5 minutes of the computer idling.&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Pie_chart.png&amp;diff=133892</id>
		<title>File:Pie chart.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Pie_chart.png&amp;diff=133892"/>
		<updated>2020-04-24T18:29:25Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: Hhleroy uploaded a new version of File:Pie chart.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pie Chart that the instructor views.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133891</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133891"/>
		<updated>2020-04-24T18:28:59Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be implemented:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits, confusing commit history, and complicated merge of E1791's code. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be manually implemented:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''UI Changes''' ==&lt;br /&gt;
The following section shows various alterations to the Expertiza user interface in order to display information about time spent on a given review. Additionally, some alterations were made to the student's user interface to assist them in their review.&lt;br /&gt;
&lt;br /&gt;
* Added time value to the table on &amp;quot;Review Reports&amp;quot; page. Found in &amp;quot;Team Reviewed&amp;quot; column of the table&lt;br /&gt;
&lt;br /&gt;
* Added a pie chart to show breakdown of where time was spent during the review.&lt;br /&gt;
&lt;br /&gt;
* Added a timeout reminder that asks the student if they are still performing the review after 5 minutes of the computer idling.&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133890</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133890"/>
		<updated>2020-04-24T18:28:45Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be implemented:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits, confusing commit history, and complicated merge of E1791's code. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be manually implemented:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''UI Changes''' ==&lt;br /&gt;
The following section shows various alterations to the Expertiza user interface in order to display information about time spent on a given review. Additionally, some alterations were made to the student's user interface to assist them in their review.&lt;br /&gt;
&lt;br /&gt;
# Added time value to the table on &amp;quot;Review Reports&amp;quot; page. Found in &amp;quot;Team Reviewed&amp;quot; column of the table&lt;br /&gt;
&lt;br /&gt;
# Added a pie chart to show breakdown of where time was spent during the review.&lt;br /&gt;
&lt;br /&gt;
# Added a timeout reminder that asks the student if they are still performing the review after 5 minutes of the computer idling.&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133889</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133889"/>
		<updated>2020-04-24T18:28:33Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be implemented:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits, confusing commit history, and complicated merge of E1791's code. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be manually implemented:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''UI Changes''' ==&lt;br /&gt;
The following section shows various alterations to the Expertiza user interface in order to display information about time spent on a given review. Additionally, some alterations were made to the student's user interface to assist them in their review.&lt;br /&gt;
&lt;br /&gt;
# Added time value to the table on &amp;quot;Review Reports&amp;quot; page. Found in &amp;quot;Team Reviewed&amp;quot; column of the table&lt;br /&gt;
# Added a pie chart to show breakdown of where time was spent during the review.&lt;br /&gt;
[[File:Example.jpg]]&lt;br /&gt;
# Added a timeout reminder that asks the student if they are still performing the review after 5 minutes of the computer idling.&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133888</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133888"/>
		<updated>2020-04-24T18:27:49Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be implemented:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits, confusing commit history, and complicated merge of E1791's code. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be manually implemented:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''UI Changes''' ==&lt;br /&gt;
The following section shows various alterations to the Expertiza user interface in order to display information about time spent on a given review. Additionally, some alterations were made to the student's user interface to assist them in their review.&lt;br /&gt;
&lt;br /&gt;
# Added time value to the table on &amp;quot;Review Reports&amp;quot; page. Found in &amp;quot;Team Reviewed&amp;quot; column of the table&lt;br /&gt;
# Added a pie chart to show breakdown of where time was spent during the review.&lt;br /&gt;
[[File:Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133887</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133887"/>
		<updated>2020-04-24T18:25:18Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be implemented:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits, confusing commit history, and complicated merge of E1791's code. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be manually implemented:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''UI Changes''' ==&lt;br /&gt;
The following section shows various alterations to the Expertiza user interface in order to display information about time spent on a given review. Additionally, some alterations were made to the student's user interface to assist them in their review.&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133883</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133883"/>
		<updated>2020-04-24T18:20:05Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits and unsatisfactory commit messages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''UI Changes''' ==&lt;br /&gt;
The following section displays&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133882</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133882"/>
		<updated>2020-04-24T18:18:59Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Proposed Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Implemented Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits and unsatisfactory commit messages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created (6)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''controllers/submission_viewing_events_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
'''spec/controllers/submission_viewing_events_controller_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
'''db/migrate/20200420201807_create_submission_viewing_events.rb''' &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/index.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/edit.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/_form.html.haml'''&lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited (18)''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''db/schema.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''config/routes.rb'''&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/new.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submission_viewing_events/show.html.haml''' &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
'''app/helpers/submitted_content_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
'''app/views/popup/view_review_scores_popup.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_submissions_time_spent.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/_submitted_files.html.erb''' &lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/view.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
'''app/views/response/response.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_main.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_hyperlink.html.erb'''&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
'''app/views/submitted_content/_submitted_files.html.erb ''' &lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/response_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
Added a catch for errors on a function call in tree_display_controller, a file not directly related to the project.  This was necessary for handling Travis CI error upon initial commit.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133860</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133860"/>
		<updated>2020-04-24T17:56:40Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Manual Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits and unsatisfactory commit messages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''controllers/submission_viewing_events_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
==== '''db/migrate/20200420201807_create_submission_viewing_events.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/index.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/edit.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/_form.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
==== '''spec/controllers/submission_viewing_events_controller_spec.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''db/schema.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/new.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/show.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/helpers/submitted_content_helper.rb'''==== &lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
===='''app/views/popup/view_review_scores_popup.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/_submitted_files.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
==== '''config/routes.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
==== '''app/controllers/response_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/view.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/response.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_main.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_hyperlink.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_submitted_files.html.erb ''' ====&lt;br /&gt;
&lt;br /&gt;
Added embedded function to .html file for tracking viewing of windows in the browser.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
* Log in as instructor&lt;br /&gt;
::Username: Insturctor6&lt;br /&gt;
::Password: password&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Assignments&amp;quot; in the drop down list&lt;br /&gt;
* Navigate to &amp;quot;Test Timetracking (FINAL)&amp;quot; assignment&lt;br /&gt;
* Click on &amp;quot;View Report&amp;quot; Icon&lt;br /&gt;
* Ensure drop down reads &amp;quot;Review Report&amp;quot; and click &amp;quot;View&amp;quot; button&lt;br /&gt;
* This will display a table with information about reviews for the assignment&lt;br /&gt;
* Select one of the reviews and click on the time value hyperlink&lt;br /&gt;
* This should display a pie chart and table with a break down of time spent on review&lt;br /&gt;
* Click on &amp;quot;Manage...&amp;quot; and select &amp;quot;Impersonate User&amp;quot; in the drop down list&lt;br /&gt;
* Enter &amp;quot;student74XX&amp;quot; where the XX can range from 90-99&lt;br /&gt;
* Navigate to &amp;quot;Assignments&amp;quot; tab&lt;br /&gt;
* Select &amp;quot;Test Timetracking (Final) review&amp;quot;&lt;br /&gt;
* Complete the review and write down about how the it took&lt;br /&gt;
* Click the &amp;quot;Revert&amp;quot; button in the header to go back to an instructor&lt;br /&gt;
* Navigate back to the &amp;quot;Review Report&amp;quot; table&lt;br /&gt;
* Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133858</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133858"/>
		<updated>2020-04-24T17:45:29Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Manual Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits and unsatisfactory commit messages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''controllers/submission_viewing_events_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
==== '''db/migrate/20200420201807_create_submission_viewing_events.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/index.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/edit.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/_form.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
==== '''spec/controllers/submission_viewing_events_controller_spec.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''db/schema.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/new.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/show.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/helpers/submitted_content_helper.rb'''==== &lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
===='''app/views/popup/view_review_scores_popup.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/_submitted_files.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
==== '''config/routes.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
==== '''app/controllers/response_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/view.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/response.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_main.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_hyperlink.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
:Username: Insturctor6&lt;br /&gt;
:Password: password&lt;br /&gt;
# Assign a review to a student&lt;br /&gt;
# Log in as student&lt;br /&gt;
# Complete the dummy review in 5 minutes&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Navigate to review report tab&lt;br /&gt;
# Verify that the review was completed ~5 minutes.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133857</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133857"/>
		<updated>2020-04-24T17:44:14Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Our Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1662/commits E1989] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages and the reason it was not integrated into expertiza was due to the amount of white space in commits and unsatisfactory commit messages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is used, however small edits were made to provide clean code and a trackable commit history. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved, the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use '''map_id''' to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''controllers/submission_viewing_events_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
==== '''db/migrate/20200420201807_create_submission_viewing_events.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/index.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/edit.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/_form.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
==== '''spec/controllers/submission_viewing_events_controller_spec.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''db/schema.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/new.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/show.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/helpers/submitted_content_helper.rb'''==== &lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
===='''app/views/popup/view_review_scores_popup.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/_submitted_files.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
==== '''config/routes.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
==== '''app/controllers/response_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/view.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/response.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_main.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_hyperlink.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Assign a review to a student&lt;br /&gt;
# Log in as student&lt;br /&gt;
# Complete the dummy review in 5 minutes&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Navigate to review report tab&lt;br /&gt;
# Verify that the review was completed ~5 minutes.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/tree/E1989_Merge_Fixes E1989 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1728/commits Pull commits]&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=vyidgf4sjcg Video Demonstartion]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133722</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133722"/>
		<updated>2020-04-24T00:44:57Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* app/views/submission_viewing_events/index.html.haml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use map_id to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''controllers/submission_viewing_events_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
==== '''20200420201807_create_submission_viewing_events.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/index.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/edit.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/_form.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''db/schema.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/new.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/show.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/helpers/submitted_content_helper.rb'''==== &lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
===='''app/views/popup/view_review_scores_popup.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/_submitted_files.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
==== '''config/routes.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
==== '''app/controllers/response_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/view.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/response.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_main.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_hyperlink.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Assign a review to a student&lt;br /&gt;
# Log in as student&lt;br /&gt;
# Complete the dummy review in 5 minutes&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Navigate to review report tab&lt;br /&gt;
# Verify that the review was completed ~5 minutes.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133721</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133721"/>
		<updated>2020-04-24T00:44:10Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Files Created */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use map_id to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''controllers/submission_viewing_events_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
==== '''20200420201807_create_submission_viewing_events.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/index.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created a simple index page for viewing of submission events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/edit.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created file to allow for editing capabilities of submission viewing events. &lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/_form.html.haml''' ==== &lt;br /&gt;
&lt;br /&gt;
Created partial form that was used to fill in edit.html.haml file, as well as a few others.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''db/schema.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/new.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/show.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/helpers/submitted_content_helper.rb'''==== &lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
===='''app/views/popup/view_review_scores_popup.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/_submitted_files.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
==== '''config/routes.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
==== '''app/controllers/response_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/view.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/response.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_main.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_hyperlink.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Assign a review to a student&lt;br /&gt;
# Log in as student&lt;br /&gt;
# Complete the dummy review in 5 minutes&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Navigate to review report tab&lt;br /&gt;
# Verify that the review was completed ~5 minutes.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133719</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133719"/>
		<updated>2020-04-24T00:36:49Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Files Edited */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use map_id to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''controllers/submission_viewing_events_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
==== '''20200420201807_create_submission_viewing_events.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''db/schema.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/new.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/show.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/helpers/submitted_content_helper.rb'''==== &lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
===='''app/views/popup/view_review_scores_popup.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/_submitted_files.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
==== '''config/routes.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
==== '''app/controllers/response_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/view.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/response.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Edited to contain two functions to track start and end time or review. Added hidden field tags to form to track timeouts, as well as a submission check to ensure reviewer is still working on review.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_main.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_hyperlink.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Assign a review to a student&lt;br /&gt;
# Log in as student&lt;br /&gt;
# Complete the dummy review in 5 minutes&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Navigate to review report tab&lt;br /&gt;
# Verify that the review was completed ~5 minutes.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133718</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133718"/>
		<updated>2020-04-24T00:33:45Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* app/views/response/view.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use map_id to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''controllers/submission_viewing_events_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
==== '''20200420201807_create_submission_viewing_events.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
==== '''app/views/response/view.html.erb''' ====&lt;br /&gt;
Edited to set submission check variable to false.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/response.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''db/schema.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/new.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/show.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/helpers/submitted_content_helper.rb'''==== &lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
===='''app/views/popup/view_review_scores_popup.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/_submitted_files.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
==== '''config/routes.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
==== '''app/controllers/response_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_main.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_hyperlink.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Assign a review to a student&lt;br /&gt;
# Log in as student&lt;br /&gt;
# Complete the dummy review in 5 minutes&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Navigate to review report tab&lt;br /&gt;
# Verify that the review was completed ~5 minutes.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133717</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133717"/>
		<updated>2020-04-24T00:22:49Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Files Edited */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the completed aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1662/commits E1989] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
Our datatable is named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the spreadsheet below. We use map_id to join '''response_maps''' table for storing the primary information. '''Round''' contains an int variable associated with the specific round review, '''link''' contains a character string storing the external link the reviewer clicked on, '''start_at''' contains the starting time the external link was pressed, while '''end_at''' contains the time when the link was closed. &lt;br /&gt;
&lt;br /&gt;
[[File:Db_FINAL.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The highlight demonstrate which field correspond to response_maps key.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema_FINAL.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Code Changes''' ==&lt;br /&gt;
Our implementation builds off of the work done in E1989. This previous project has a substantial amount of the functionality already completed for tracking and viewing external pages and certain types of files. The primary error in this implementation is that when multiple files are open, the times at which they record reviews are overlapped creating inaccurate review reports. The displayed review report will also need to be edited to present review reports in a visually appealing manner. The following changes were made:&lt;br /&gt;
&lt;br /&gt;
=== '''Files Created''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''controllers/submission_viewing_events_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function.  Includes three methods&lt;br /&gt;
&lt;br /&gt;
# record_start_time :  function starts the time for links that have been visited by the user.&lt;br /&gt;
# record_end_time : records the end time for links that have been visited by the user.&lt;br /&gt;
# mark_end_time :  records the end time for links that have no end times.&lt;br /&gt;
&lt;br /&gt;
==== '''20200420201807_create_submission_viewing_events.rb''' ==== &lt;br /&gt;
&lt;br /&gt;
Migration file to create data table for handling log start and end time for each link/file in the review.  Created using rails 'generate model' function.  More info regarding schema is included in the Database section.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
==== '''app/views/response/view.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/response.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''db/schema.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to accurately log viewing times for multiple links open at the same time.  This will include creating methods such as calculateTime to help with parsing review times of different links, and a function drawChart to display review times in a visually appealing manner.&lt;br /&gt;
&lt;br /&gt;
====  '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
will be edited to reflect chart made in _review_submissions_time_spent.html.erb&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/new.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created new.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submission_viewing_events/show.html.haml'''==== &lt;br /&gt;
&lt;br /&gt;
Created show.html.haml for submission_viewing_events for assisting in setting up the views.&lt;br /&gt;
&lt;br /&gt;
==== '''app/helpers/submitted_content_helper.rb'''==== &lt;br /&gt;
&lt;br /&gt;
Updated line 32 to incorporate file link for the return variable, ret.&lt;br /&gt;
&lt;br /&gt;
===='''app/views/popup/view_review_scores_popup.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Break up query in line 55 into two queries.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_submissions_time_spent.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Created a view for reports controller.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/reports/_review_report.html.erb'''==== &lt;br /&gt;
&lt;br /&gt;
Made changes to _review_report to reflect changes in reports_controller&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/response/_submitted_files.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added JavaScript to this file which allows tracking of start and end times of accessing a hyperlink. Most functionality is on-click for tracking these times.&lt;br /&gt;
&lt;br /&gt;
==== '''config/routes.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added collection for start and end times when hyperlink is accessed. Includes post and get calls for recording start and end times as necessary (see lines 420-428)&lt;br /&gt;
&lt;br /&gt;
==== '''app/controllers/response_controller.rb''' ====&lt;br /&gt;
&lt;br /&gt;
Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_main.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Added checks for local assignment submissions, where if true a partial specifically for hyperlinks and submitted files are loaded. See lines 10-20 for specific changes.&lt;br /&gt;
&lt;br /&gt;
==== '''app/views/submitted_content/_hyperlink.html.erb''' ====&lt;br /&gt;
&lt;br /&gt;
Adds functionality to ensure that user must click on a hyperlink instead of copying and pasting the link. From line 41-end there is more JavaScript that marks start and end times for accessing these hyperlinks.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. The primary controller for testing will be controllers/submission_viewing_events_controller.rb, as edits will be made to mark_end_time and record_end_time methods to ensure that recorded review times for resources are not overlapping.&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Assign a review to a student&lt;br /&gt;
# Log in as student&lt;br /&gt;
# Complete the dummy review in 5 minutes&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Navigate to review report tab&lt;br /&gt;
# Verify that the review was completed ~5 minutes.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattler &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133481</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133481"/>
		<updated>2020-04-14T01:03:05Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Rspec */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''Files to be Added and Edited''' ==&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. &lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data&lt;br /&gt;
&lt;br /&gt;
Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Assign a review to a student&lt;br /&gt;
# Log in as student&lt;br /&gt;
# Complete the dummy review in 5 minutes&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Navigate to review report tab&lt;br /&gt;
# Verify that the review was completed ~5 minutes.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattle &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133476</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133476"/>
		<updated>2020-04-14T01:01:35Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Rspec */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
== '''Files to be Added and Edited''' ==&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
== '''User Stories''' ==&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
== '''Database Schema''' ==&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
Proposed Rspec Tests:&lt;br /&gt;
* When a new review is started probe the Expertiza timer and ensure it returns the start value (0)&lt;br /&gt;
* When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database&lt;br /&gt;
* When an external link is clicked on a new review probe the timer link for that link and ensure it returns the start value (0)&lt;br /&gt;
* When an external link is clicked on a previously saved review probe the timer link for that link and ensure it returns and ensure it returns the time value stored in the database&lt;br /&gt;
* When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution&lt;br /&gt;
* When a review is clicked on by the instructor the data returned from date base should match test data&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Assign a review to a student&lt;br /&gt;
# Log in as student&lt;br /&gt;
# Complete the dummy review in 5 minutes&lt;br /&gt;
# Log in as instructor&lt;br /&gt;
# Navigate to review report tab&lt;br /&gt;
# Verify that the review was completed ~5 minutes.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
=== Useful Links ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza Repo] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza E1791 Repo]&lt;br /&gt;
&lt;br /&gt;
=== Our Implementation ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jamcdon3/expertiza/tree/E2015 Github Repo:] &amp;lt;br /&amp;gt;&lt;br /&gt;
[https://github.com/rohanpillai20/expertiza/pull/51 Pull Request:]&lt;br /&gt;
&lt;br /&gt;
=== Team Information ===&lt;br /&gt;
'''Mentor:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Abhirav Kariya &lt;br /&gt;
&lt;br /&gt;
'''Students:''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Hartley Leroy &amp;lt;br /&amp;gt;&lt;br /&gt;
John McDonald &amp;lt;br /&amp;gt;&lt;br /&gt;
Christian Morris &amp;lt;br /&amp;gt;&lt;br /&gt;
Tyler Sattle &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133397</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133397"/>
		<updated>2020-04-14T00:23:41Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Design pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133386</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133386"/>
		<updated>2020-04-14T00:11:55Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Proposed Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints about the use of a tabular method that was implemented in [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], stating that the review report table becomes too cluttered, we intend to create a pop-up window that will display the results in a table or graph of some sort. The proposed pop up will display all necessary information in a neat and simple self contained form. The exact display is undetermined, however proposed solutions include another tabular design, bar graphs, pie charts, etc.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133377</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133377"/>
		<updated>2020-04-14T00:06:11Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Proposed Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method that was implemented in ..., citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133372</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133372"/>
		<updated>2020-04-14T00:00:43Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Student */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133371</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133371"/>
		<updated>2020-04-13T23:55:36Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review is most important. One can track the amount of time spent on the review by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a resource is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and resources should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
*There are a few solutions one could implement to fix such an issue, such as marking both the start time and end time for when an external link or application was accessed by a user. Another solution which we will attempt in our first iteration of development is to track the time that an external link was clicked, and use the submission time of the review as our estimated end time for the external link. We thought of this design choice because once the report is submitted, the access time to external links should be stopped since the review is complete.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.&lt;br /&gt;
====Student====&lt;br /&gt;
Students will be interacting with the implementation when filling out a review. A similar workflow from [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 Fall '19] is used, however small edits were made to better suite our proposed implementation. Initially, the user will click on the review they want to complete. Once the link is clicked the time will start to be logged. Upon the clicking of an external link another another timer will begin tracking it. This process repeats until the submission is saved/submitted or the page is exited out of. In the case where a review was previously saved the timer will pick up from the last tracked time. The diagram below displays the flow of interactions visually.&lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]] &lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from [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 Fall '19] will be used for the instructor  with minor changes. Firstly, the instructor will navigate to a page that displays all current and previously reviews. They will then be able to select a review from the given list and look at statistics about resources accessed and time spent on each resource. Saved reviews and already submitted reviews will be tagged differently. The diagram below displays the flow of interactions visually.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133359</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133359"/>
		<updated>2020-04-13T23:41:16Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
====Student====&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]] &lt;br /&gt;
&lt;br /&gt;
====Instructor====&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133358</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133358"/>
		<updated>2020-04-13T23:40:35Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself by tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
[[File:User_Story.png| center |Image: 50 pixels]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 50 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133351</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133351"/>
		<updated>2020-04-13T23:32:49Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories Flow Charts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
==== User Stories Flow Charts ====&lt;br /&gt;
Flowcharts that define our user stories visually are displayed below.The first image follows how a student would interact with the implementation, and the second shows how an instructor would interact with the implementation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:User_Story.png |Image: 50 pixels]]     [[File:Instructor_Story.png |Image: 50 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133350</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133350"/>
		<updated>2020-04-13T23:32:27Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories Flow Charts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
=== User Stories Flow Charts ===&lt;br /&gt;
Flowcharts that define our user stories visually are displayed below.The first image follows how a student would interact with the implementation, and the second shows how an instructor would interact with the implementation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:User_Story.png |Image: 50 pixels]]     [[File:Instructor_Story.png |Image: 50 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133347</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133347"/>
		<updated>2020-04-13T23:30:54Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories Flow Charts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Expertiza is an open source software project created using Ruby on Rails. Expertiza allows instructors to craft new assignments and edit existing ones. This flexibility ensures that each round of students gets an experience that is appropriate to the given situation. It also allows the instructor to create a list of project options and have the students bid for their favorite project.&lt;br /&gt;
&lt;br /&gt;
While their are a plethora of benefits for instructors, students also gain some benefits when using Expertiza. They are able to form teams and keep track of the past peers they have worked with, and are also able to manage the progress and submission of their assignments.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
=== User Stories Flow Charts ===&lt;br /&gt;
Flowcharts that define our user stories visually are displayed below.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:User_Story.png |Image: 50 pixels]][[File:Instructor_Story.png |Image: 50 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133340</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133340"/>
		<updated>2020-04-13T23:24:13Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Enter abstract here.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
=== User Stories Flow Charts ===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:User_Story.png |Image: 50 pixels]]           [[File:Instructor_Story.png |Image: 50 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133337</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133337"/>
		<updated>2020-04-13T23:23:10Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Enter abstract here.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
== User Stories ==&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:User_Story.png |Image: 50 pixels]]           [[File:Instructor_Story.png |Image: 50 pixels]]&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133333</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133333"/>
		<updated>2020-04-13T23:22:16Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Enter abstract here.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
[[File:User_Story.png |Image: 50 pixels]][[File:Instructor_Story.png |Image: 50 pixels]]&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133330</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133330"/>
		<updated>2020-04-13T23:20:45Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Enter abstract here.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
[[File:User_Story.png | center |Image: 100 pixels][File:Instructor_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133329</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133329"/>
		<updated>2020-04-13T23:20:32Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
Enter abstract here.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementations''' ==&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
[[File:User_Story.png | center |Image: 100 pixels]][[File:Instructor_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133320</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133320"/>
		<updated>2020-04-13T23:14:49Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
[[File:User_Story.png,Instructor_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133317</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133317"/>
		<updated>2020-04-13T23:13:51Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
[[File:User_Story.png | left |Image: 100 pixels]][[File:Instructor_Story.png | right |Image: 100 pixels]]&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133316</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133316"/>
		<updated>2020-04-13T23:13:12Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* User Stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
=== User Stories ===&lt;br /&gt;
&amp;lt;b&amp;gt;Student&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
[[File:User_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Edited ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below shows the database relationship with other tables. '''submission_viewing_events''' will be touching '''response_maps'''. The boxes demonstrate which fields correspond to each other.&lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema1.png | center]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133229</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133229"/>
		<updated>2020-04-13T18:08:51Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Design pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;User&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
[[File:User_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:Instructor_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Editted ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Instructor_Story.png&amp;diff=133228</id>
		<title>File:Instructor Story.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Instructor_Story.png&amp;diff=133228"/>
		<updated>2020-04-13T18:08:20Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133227</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133227"/>
		<updated>2020-04-13T17:52:05Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Design pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;User&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
[[File:User_Story.png | center |Image: 100 pixels]]&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:E1989_Instructor_flowchart.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Editted ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:User_Story.png&amp;diff=133226</id>
		<title>File:User Story.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:User_Story.png&amp;diff=133226"/>
		<updated>2020-04-13T17:50:58Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:User_Story_.png&amp;diff=133225</id>
		<title>File:User Story .png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:User_Story_.png&amp;diff=133225"/>
		<updated>2020-04-13T17:50:10Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133224</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133224"/>
		<updated>2020-04-13T17:49:48Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Design pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;User&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once again, a similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:E1989_Instructor_flowchart.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Editted ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133223</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133223"/>
		<updated>2020-04-13T17:49:32Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Design pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;User&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implementation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:E1989_Instructor_flowchart.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Editted ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133222</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=133222"/>
		<updated>2020-04-13T17:49:13Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Design pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review.  It is important that functionality be added so Expertiza can track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
The overall amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened untill when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
The following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature.  Previous attempts to implement this functionality have been made but the work was not merged into Expertiza code base for various reason. These previous projects are summarized below:&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both.  Tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&amp;lt;b&amp;gt;User&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] is used, however small edits were made to the diagram to better suite our proposed implmnetation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:E1989_Instructor_flowchart.png | center |Image: 100 pixels]]&lt;br /&gt;
&lt;br /&gt;
=== Files to be Added and Editted ===&lt;br /&gt;
&lt;br /&gt;
# Create a controller to handle the start/end times of the files viewed by the user in =&amp;gt; controllers/submission_viewing_events_controller.rb&lt;br /&gt;
# Create a datatable to handle log start and end time for each link/file.  Schema for this table is provided in the below section.&lt;br /&gt;
# Edit and add views to display results in a user-friendly manner.  Edits to views should be defined in both the wiki and through modular commits on the repository in order to clearly distinguish code changes, an issue that prevented [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] from pushing to base.&lt;br /&gt;
&lt;br /&gt;
=== Database Schema ===&lt;br /&gt;
&lt;br /&gt;
Our datatable will be named '''submission_viewing_events'''.  The attributes and their descriptions are provided in the below spreadsheet.  There is some uncertainty in how the time will be tracked separately for viewing downloadable files vs viewing the Expertiza assignment review page.  Final form of the data table with this tracking feature will be elaborate on in future submissions.  &lt;br /&gt;
&lt;br /&gt;
[[File:Db_schema.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
===Rspec=== &lt;br /&gt;
Automatic testing will be achieved using Rspec. We will test the changes made to controllers/submission_viewing_events_controller.rb to ensure proper test converge.  Test cases are to be written in a meaningful and elegant manner, adhering to the following rules:&lt;br /&gt;
&lt;br /&gt;
* Test incoming query messages by making assertions for what they send back&lt;br /&gt;
* Test incoming command messages by making assertions about direct public side effects&lt;br /&gt;
* Do not test private methods&lt;br /&gt;
* Do not test outgoing query messages&lt;br /&gt;
* Expect to send outgoing command messages&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
1. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
2. Assign a review to a student&lt;br /&gt;
&lt;br /&gt;
3. Log in as student&lt;br /&gt;
&lt;br /&gt;
4. Complete the dummy review in 5 minutes&lt;br /&gt;
&lt;br /&gt;
5. Log in as instructor&lt;br /&gt;
&lt;br /&gt;
6. Navigate to review report tab&lt;br /&gt;
&lt;br /&gt;
7. Verify that the review was completed ~5 minutes.&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=132913</id>
		<title>CSC/ECE 517 Spring 2020 / E2023 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_Spring_2020_/_E2023_Track_the_Time_Students_Look_at_Other_Submissions&amp;diff=132913"/>
		<updated>2020-04-08T02:21:26Z</updated>

		<summary type="html">&lt;p&gt;Hhleroy: /* Proposed Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Understanding how much time a student spends reviewing another's work is beneficial in order to better estimate the quality of said review. Given that fact it is important that Expertiza is able to track and display the given amount of time a student spends on a review.&lt;br /&gt;
&lt;br /&gt;
The time spent on each review is a summation of multiple sources:&lt;br /&gt;
* Time spent of the Expertiza review itself&lt;br /&gt;
* Time spent looking at external links&lt;br /&gt;
* Time spent looking at downloadable files&lt;br /&gt;
&lt;br /&gt;
However, overall the amount of time directly spent on the review itself is most important. One can track the amount of time spent on the review itself quite easily by simply tracking the amount of time from when the page is opened till when the review is saved/submitted. Therefore, being able to track the time from once a link is opened till when the review is saved/submitted will provide a reasonable estimate of the amount of time spent on each resource. This has the benefit of only needing to track information interacted with on the Expertiza review page, as opposed to other external files and links.&lt;br /&gt;
&lt;br /&gt;
Therefore, the following tasks need to be accomplished:&lt;br /&gt;
# Time spent on an Expertiza review must be tracked&lt;br /&gt;
# Time spent on external links and documents should be tracked/estimated&lt;br /&gt;
# Overall time spent on the review should be displayed in a &amp;quot;user friendly manner&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
Thus far, Expertiza does not have the aforementioned feature, however previous work was undertaken by other teams. The prior work of other teams was not merged into the Expertiza code base do to the following issues.&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/875 E1705] identified how to track the active time of windows opened from the submitted links. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1124 E1791] provided detailed insights on how they planned to track time taken by a student in viewing a submission and possible edge cases. Further, they also implemented popups and figured out a way to open downloadable files. However, the details are rendered in a not-so-friendly manner and hence it was not merged. &lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1309 E1872] tried to solve this by incorporating the statistics in the review reports page, but their UI made the page cluttered and not friendly. Further, it was hard to identify which statistic belonged to which review, and there were almost no tests. ([http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions Wiki])&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] tried to solve this by building off of [https://github.com/expertiza/expertiza/pull/1124 E1791]. The team took the base code and attempted to implement the ability to track time spent on the review page, as well as other external links, however the code was not merged due to a large amount of white-space, as well as difficulty in distinguishing actual code changes.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
In review of previous iterations of this project, it was found that project [https://github.com/expertiza/expertiza/pull/1124 E1791] would prove to be a good starting point for completion of this project's requirements. This build has already implemented systems that help track time spent viewing external pages. To achieve our goals outlined in the [[#Problem Statement|Problem Statement]], the following changes need to be made:&lt;br /&gt;
&lt;br /&gt;
; The time spent on the Expertiza assignment review page needs to be tracked. &lt;br /&gt;
*Due to Expertiza generating report text boxes with HTML iFrames, we will track whether or not the document hasFocus() to determine when a student is on the page or not.&lt;br /&gt;
*After 5 minutes of mouse/keyboard inactivity, a popup is displayed asking if the user is still working. At that point, the time contributed towards the total by the Expertiza page is paused until the user interacts with the popup to indicate they are still working. This is already implemented in project [https://github.com/expertiza/expertiza/pull/1124 E1791].&lt;br /&gt;
&lt;br /&gt;
; The time spent viewing the external links/downloadable files needs to be tracked or estimated&lt;br /&gt;
*Currently, if a student has an external link open as well as the Expertiza page, time is being tracked for both, however tracking of external links may be unnecessary for the project, and instead an estimation approach may be taken. Either way it is likely that this measurement will be altered throughout development of this project.&lt;br /&gt;
&lt;br /&gt;
; The overall time spent on the review needs to be displayed in a &amp;quot;user friendly manner&amp;quot; on the &amp;quot;Review Report&amp;quot; page.&lt;br /&gt;
*Due to complaints on a tabular method, citing the review report table becoming too cluttered, we intend to create a pop-up window that will display the results in a table. Unlike the approach taken in project [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 from the fall of 2019], this project will work to display all information using the aforementioned tabular design in a pop-up window. With this approach, the table provides the information and estimates regarding all of the external links accessed throughout this review in a simple and uncluttered fashion.&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
'''Strategy:''' This project, for each review page, deals with different type of links. Javascript is used to track the access time for online links, such as github repo, youtube links, and more. For submitted files, such as txt, jpg, we will time it with  views/response/_submitted_files.html.erb.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Instructor&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A similar workflow from [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 Fall '19] will be used for an instructor to access the tabularized information regarding access times:&lt;br /&gt;
[[File:E1989_Instructor_flowchart.png | center]]&lt;/div&gt;</summary>
		<author><name>Hhleroy</name></author>
	</entry>
</feed>