CSC/ECE 517 Spring 2020 / E2023 Track the Time Students Look at Other Submissions

From Expertiza_Wiki
Jump to navigation Jump to search

Abstract

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.

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.

Problem Statement

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.

The time spent on each review is a summation of multiple sources:

  • Time spent of the Expertiza review itself
  • Time spent looking at external links
  • Time spent looking at downloadable files

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.

The following tasks need to be implemented:

  1. Time spent on an Expertiza review must be tracked
  2. Time spent on external links and resources should be tracked/estimated
  3. Overall time spent on the review should be displayed in a "user friendly manner"

Previous Implementations

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:

  1. E1705 identified how to track the active time of windows opened from the submitted links.
  2. 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.
  3. 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. (Wiki)
  4. E1989 tried to solve this by building off of 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.

Implemented Solution

In review of previous iterations of this project, it was found that project 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, 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:

The time spent on the Expertiza assignment review page needs to be tracked.
  • 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.
  • 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 E1791.
The time spent viewing the external links/downloadable files needs to be tracked or estimated
  • 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.
  • 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.
The overall time spent on the review needs to be displayed in a "user friendly manner" on the "Review Report" page.
  • Due to complaints about the use of a tabular method that was implemented in 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.

User Stories

The following section outlines the predicted user interactions with our software. Two potential users have been identified; users and instructors.

Student

Students will be interacting with the implementation when filling out a review. A similar workflow from 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.

Image: 50 pixels
Image: 50 pixels

Instructor

Instructors will be interacting with the implementation when the are observing student reviews. Once again, a similar story from 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.

Image: 50 pixels
Image: 50 pixels

UI Changes

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.

  • Added time value to the table on "Review Reports" page. Found in "Team Reviewed" column of the table
  • Added a pie chart to show breakdown of where time was spent during the review.
Image: 50 pixels
Image: 50 pixels
  • Added a timeout reminder that asks the student if they are still performing the review after 5 minutes of the computer idling.
Image: 50 pixels
Image: 50 pixels

Database Schema

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.


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.

Code Changes

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:

Files Created (6)


controllers/submission_viewing_events_controller.rb

Creates a controller for handling events of submission viewing reviews. Created using rails 'generate controller' function. Includes three methods

  1. record_start_time : function starts the time for links that have been visited by the user.
  2. record_end_time : records the end time for links that have been visited by the user.
  3. mark_end_time : records the end time for links that have no end times.

spec/controllers/submission_viewing_events_controller_spec.rb

Implemented test cases for created SubmissionViewingEventsController using Rspec as per expertiza standard.

db/migrate/20200420201807_create_submission_viewing_events.rb

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.

app/views/submission_viewing_events/index.html.haml

Created a simple index page for viewing of submission events.

app/views/submission_viewing_events/edit.html.haml

Created file to allow for editing capabilities of submission viewing events.

app/views/submission_viewing_events/_form.html.haml

Created partial form that was used to fill in edit.html.haml file, as well as a few others.

Files Edited (18)


db/schema.rb

Updated to include the SubmissionViewingEvents model migration, as executed via a 'rake db:migrate"

config/routes.rb

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)

app/views/submission_viewing_events/new.html.haml

Created new.html.haml for submission_viewing_events for assisting in setting up the views.

app/views/submission_viewing_events/show.html.haml

Created show.html.haml for submission_viewing_events for assisting in setting up the views.

app/helpers/submitted_content_helper.rb

Updated line 32 to incorporate file link for the return variable, ret.

app/views/popup/view_review_scores_popup.html.erb

Break up query in line 55 into two queries.

app/views/reports/_review_submissions_time_spent.html.erb

Created a view for reports controller.

app/views/reports/_review_report.html.erb

Made changes to _review_report to reflect changes in reports_controller

app/views/reports/_review_submissions_time_spent.html.erb

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.

app/views/reports/_review_report.html.erb

will be edited to reflect chart made in _review_submissions_time_spent.html.erb

app/views/response/_submitted_files.html.erb

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.

app/views/response/view.html.erb

Edited to set submission check variable to false.

app/views/response/response.html.erb

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.

app/views/submitted_content/_main.html.erb

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.

app/views/submitted_content/_hyperlink.html.erb

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.

app/views/submitted_content/_submitted_files.html.erb

Added embedded function to .html file for tracking viewing of windows in the browser.

app/controllers/response_controller.rb

Added field @current_round to file for tracking the current round of reviews for a student. See lines 83 and 267 for variable instantiation.

app/controllers/tree_display_controller.rb

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.

Testing Plan

Rspec

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.

Proposed Rspec Tests:

  • When a new review is started probe the Expertiza timer and ensure it returns the start value (0)
  • When a saved review is started again probe the Expertiza timer and ensure it returns the time value stored in the database
  • 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)
  • 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
  • When a review is saved/submitted ensure that the time sent to the database matches time stored in database after execution
  • When a review is clicked on by the instructor the data returned from date base should match test data.

Manual Testing

  • Log in as instructor
Username: Insturctor6
Password: password
  • Click on "Manage..." and select "Assignments" in the drop down list
  • Navigate to "Test Timetracking (FINAL)" assignment
  • Click on "View Report" Icon
  • Ensure drop down reads "Review Report" and click "View" button
  • This will display a table with information about reviews for the assignment
  • Select one of the reviews and click on the time value hyperlink
  • This should display a pie chart and table with a break down of time spent on review
  • Click on "Manage..." and select "Impersonate User" in the drop down list
  • Enter "student74XX" where the XX can range from 90-99
  • Navigate to "Assignments" tab
  • Select "Test Timetracking (Final) review"
  • Complete the review and write down about how the it took
  • Click the "Revert" button in the header to go back to an instructor
  • Navigate back to the "Review Report" table
  • Confirm appropriate entry was added to the table and matches, or is near, the personally recorded time

References

Useful Links

Expertiza Repo
E1791 Repo
E1989 Repo

Our Implementation

Github Repo:
Pull Request:
Pull commits
Video Demonstartion

Team Information

Mentor:
Abhirav Kariya

Students:
Hartley Leroy
John McDonald
Christian Morris
Tyler Sattler