MarkUs Blog

MarkUs Developers Blog About Their Project

Archive for the ‘Developer Essentials’ Category

Status Report – October 31

without comments

Chris

This Week:

  • Completed initial prototype of PDF viewer.
  • Learned how the asset pipeline works so that all the files needed for the viewer can be compiled as one.

Next Week:

  • Fix bug where the viewer javascript is loaded for each new pdf request.
  • Begin adding annotations.

 

 Jakub Subczynski

This Week:

  • Rewrote Assignment#group_assignment?
  • Increased code coverage by creating new test
  • Migrated some rake tests over

Next Week:

  • Continue test migration

Roadblocks:

  • Spent considerable amount of time troubleshooting a failing test I wrote

Yusi

This Week:

  • Ran test one by one /test/unit directory (model tests) and fixed test errors

Next Week:

  • Fix test errors under /test/functional directory (controller)

Errors:

test/functional/automated_tests_controller_test.rb (13 tests, 12 assertions, 5 failures, 2 errors, 0 skips)
test/functional/grade_entry_forms_controller_test.rb (20 errors)
test/functional/groups_controller_csv_upload_test.rb (2 failures)
test/functional/groups_controller_test.rb (1 error)
test/functional/main_controller_test.rb (12 errors)
test/functional/marks_graders_controller_test.rb (3 errors)
test/functional/notes_controller_test.rb (18 errors)
test/functional/results_controller_test.rb (4 errors)
test/functional/role_switching_test.rb (2 failures)
test/functional/submissions_controller_test.rb (1 warning)

Written by Chris Kellendonk

October 31st, 2014 at 2:29 pm

MarkUs Tagging Feature – First Prototype

without comments

After several weeks, the first prototype of the tagging feature has been implemented. While the views for this feature are not final, this gives an idea of what the final product may look like. In the next few weeks, Nathan and I will be hooking the tagging views into the controller and model.

Feedback on the new views is very much encouraged! This is still a work in progress. Without further ado, here are some screenshots of the views.

The Tag View:

The new "Tag Creation" view for the tagging feature. Note the React table and sidebar upload and download buttons. Currently, the tag data being displayed in the table is just dummy data that is hard-coded into the view. Don't worry! This will change soon! MarkUs Tagging Feature - Tag Creation View

As shown in the previous blog post, this is the Tag view. This view is used for creating and managing specific tags for an assignment. The user is able to add, edit or delete tags and see the tag usage across assignments.

The Submissions View:

From here, we now have our Submissions view. Notice the new column in the submissions table for tags. This will hold all tags assigned to that submission.

From here, we now have our Submissions view. Notice the new column in the submissions table for tags. This will hold all tags assigned to that submission.

In the submissions table, when the user puts their mouse over the Tags column, a dropdown appears featuring a search bar to filter by tags and a list of tags that they can filter by. To make the dropdown concise, only the top 5 most used tags will be featured in the list. Others can be accessed by searching for them.

In the submissions table, when the user puts their mouse over the Tags column, a dropdown appears featuring a search bar to filter by tags and a list of tags that they can filter by. To make the dropdown concise, only the five most used tags will be featured in the list. Others can be accessed by searching for them.

Individual Submission View:

In the individual submissions (Review) view, A new tag tab has been added to the right sidebar of the screen. In it, TAs will be able to add and remove tags from a current assignment and also see most used tags. Admins will have the additional ability to add or remove tags as they see fit.

In the individual submissions (Review) view, a new tag tab has been added to the right sidebar of the screen. In it, TAs will be able to add and remove tags from a current assignment and also see most used tags. Admins will have the additional ability to add or remove tags as they see fit.

There you have it. As always, feel free to check out the tagging branch of the MarkUs repo and again, feel free to suggest any improvements that you have on the feature.

Written by Bryan Muscedere

October 30th, 2014 at 7:29 am

Status Report – October 28

without comments

Bryan
This Week:
  • Completed initial prototypes for the Tagging feature views. This includes a new tagging view and additions to the Submissions and Results views to implement the tagging features.
  • Created CSS elements for tags and tagging features.
  • Improved my proficiency in CSS.

Next Week:

  • Getting feedback on the initial prototype and making improvements to it.
  • Cleaning up some of the visual elements to make them conform to the MarkUs standard.
Irene
This Week:
  • Learned about how the controller connects with the models and views
  • Completed dashboard design (sketch and wireframe)
  • Started implementation of the new dashboard. I have split the view into two with the list of assignments and grading spreadsheets on the left but I am still trying to change the view on the right through links in the list. Still trying to figure out how the controller links to the view (getting a nil class error)

Next Week:

  • Continue to implement the dashboard. Next I will need to implement the functionality t hat determines which assignment to display.
Nathan
Last Week
  • finished implementing proof-of-concept to create tags associated with groupings, save in database, and retrieve tags by groupings when loading submissions table
  • minor revisions to migration files as a result of the code I implemented this week
  • opened pull request with migration files and models
Next Week
  • I’m not quite sure what I should do prior to Bryan’s view implementation being merged into the tagging branch.  Once that is merged in, I will implement the code in the correct places to allow creation of tags wherever he has created an UI to do so.  Also I will implement the code to retrieve tags wherever tags are displayed.
Tori
Last Week
  • converting repo browser table to React

Next Week

  • finish converting repo browser table to React

Written by Irene Fung

October 28th, 2014 at 3:49 pm

Status Report – October 24th

without comments

Chris

This Week:

  • UI Fixes with the PDF viewer.
  • Very busy week so not as much work was completed as I would have liked.

Next Week:

  • Complete PDF.JS UI so that the viewer does not interfere with the page.
  • Work on front end annotation system.

Jakub Subczynski

This week:

  • Pushed updated rspec tests from previous week
  • Did not have much time to work on more testing due to other assignments and midterm

Next Week:

  • Move more tests over
  • Make up last weeks work

Written by Chris Kellendonk

October 24th, 2014 at 3:10 pm

Status Reports – Oct 21

without comments

Nathan

Last Week

  • revised the proposed schema for database definitions upon further research/readings
  • implemented two migration files for creating Tags Model and a join table for the has_many_and_belongs_to relationships between tags and groupings
  • implemented some code to retrieve tags for each grouping when the submissions table is loaded (hasn’t been tested yet)

This Week

  • sync up with David/Bryan about my migration files
  • implement code to create tags (need to sync with Bryan exactly what information the user will enter for each tag i.e. name, description) etc.
  • once code to create tags is implemented, test creating tags and retrieving when submissions table loaded

Irene

Last Week

  • revised Dashboard plan based on feedback from Karen and David
  • sketched three versions of Dashboard wireframes and chose one with feedback from David
  • started implementing the changes (phase one: separate the view with list on the left that controls the details on the right)

This Week

  • continue implementation of new design
  • commit phase one

 

Written by Nathan Chow

October 21st, 2014 at 6:22 pm

Status Reports – October 17

without comments

Jakub Subczynski

This week:

  • I posted a couple of issues, #1840 and #1841, that both deal with adding consistency to the application
  • I have been working on converting the rake Assignment tests over. There are many!

Next week:

  • I hope to have the majority of the rake Assignment test both reviewed and ported over by the end of the week.

Chris

This Week:

  • I was able to get the PDF.js viewer is in MarkUs, and can view, and control zoom on PDFs.

Next Week:

  • Finish some implementation details and cleanup code with the viewer.
  • Fix styling problems with the viewer in MarkUs.

Yusi 

This Week:

  • Fix deprecation warning according to server log from running rspec test.(Relation#all, Relation#first warnings etc),
    but there are still many deprecation warnings and errors when I run rake test.
  • Fix the error when log in as admin.

Next Week:

  • Eliminate more deprecation warnings and errors.

Written by Jakub Subczynski

October 17th, 2014 at 1:31 pm

Status Report October 10th

without comments

Chris

Last Week:

  • Modified the collection process so that PDF files are not converted to images.
  • Worked on integrating the full PDF.JS viewer into the grading page.

Roadblocks:

  • Wasn’t able to work on the CSV upload problem because the VM still needs to be configured fully.

This Week:

  • Complete integration of the viewer into the page.
  • Plan and start implementing annotations.

Yusi

Last Week:

  • Upgraded rails to 4.0 before upgrading to 4.1.
  • Wrapped the conditions, order in lambda. The syntax we used before caused errors after upgrading to rails 4

Roadblocks:

  • An error related to Active Record appears When log in as admin. The error disappeared when i switched back to rails 3.

This Week:

Fix Deprecation warnings and errors.

Jakub Subczynski

Last week:

  • pushed rspec tests for the Assignment model’s associations and attributes
  • Learned more rspec for the next tests I will write.

This week:

  • Test the Assignment model methods and carry over existing tests from rake test.

Written by Chris Kellendonk

October 10th, 2014 at 12:44 pm

Status Report for October 3rd

without comments

Chris

Last Week:

  • Researched and created a blog post outlining the feasibility of PDF.js
  • Made some prototypes to prove PDF.js could work for annotations.

Road Blocks

  • Not much documentation outlining the actual PDF.js API so a lot of reverse engineering of the code needed to be done.

This Week

  • Start implementing PDF.js annotation system.
  • Continue work on CSV upload problem.

Yusi

Last Week:

  • Submitted pull request for Mark model RSpec test.
  • Researched and read some documentation about upgrading from rails 3.2 to rails 4, made a small to do list.

This Week

  • Start working on the upgrade by following checklist in the upgrade guide.
  • Find new issue to fix.

 

Written by Chris Kellendonk

October 3rd, 2014 at 2:03 pm

PDF Viewing and Annotation Improvements

without comments

Current Problems with PDF Viewing and  Annotations

  • Collecting all submissions is slow because all the PDFs need to be converted into images first. This is a slow, expensive, and fragile operation.
  • Images are not resized and display at their native resolution. This can cause a poor user experience on smaller screens forcing the user to scroll around the page in order to view the entirety of the image.
  • Annotations don’t always seem as perfectly fluid as the screen is scrolled.

After research the state of online PDF viewers there does not appear to be many free options that would allow us to do all of the things we need to be able to do in a PDF. There is one library that stands out called PDF.js. It solves many but not all of these issues for us.

How PDF.js Can Help

  • There is no longer a need to do any type of pre-computation or conversion in order to view the PDFs. This cuts down significantly on the collection time of assignments that are mainly composed of PDF documents. As well as completely removes the fragile conversion process.
  • The library has the ability to control the zoom level and rotation of the document. Thus allowing large documents to be viewed easily on most devices.
  • It can print a document if need be.
  • As well as supports the native navigation options in PDF files. Such as paging, page previews, and the document outline (i.e. navigating through a table of contents).

All of the above features are supported natively, however the one major feature for us the library is missing is support for adding annotations to an existing document. Which is a core feature of the current system. This is something that would need to be implemented by hand as there are no existing solutions for this library or any other free online system.

Annotating PDFs

PDF.js does not support creating annotations on a document natively. It can display annotations that are already embedded in the PDF but cannot create new ones. I did investigate trying to use the native annotation system however there is not much documentation about how it actually is used so the code would need to be partially reverse engineered to determined exactly what it is doing. Using the native annotation system would be one option. The other could be achieved using the framework that the PDF.js library provides during its normal rendering process.

Technical Details

  1. A PDF could be annotated by creating a annotation layer that sits directly above the canvas and text layers that PDF.js renders. These elements would be rendered in the DOM to allow easy manipulation through Javascript. Such as “onHover” events to show the text when the user hovers their mouse over the annotation. Since each canvas sits inside a “page” container class with absolute positioning this allows any DOM elements to also be positioned so that they line up perfectly with the canvas beneath. Annotations could be positioned within this layer.
  2. The position and size of the annotations would be based off the current scale of the document when the annotation was added. All annotation size and positions would then be normalized so that when storing them in the database all coordinates are based off the document being at a 100% scale.
  3. The main hurdle with this system is keeping the position of the annotations in line with the document as it is zoomed and rotated. However this is not impossible and there are hooks into the API that would allow for this to be managed. Using `PDFView.currentScale` we can get the current scale of the document and adjust the annotation scaling and position to the document as the zoom level changes. The same technique could then be applied for rotation.

I believe using PDF.js is a viable option that could provide a superior benefit to the graders marking PDF files. It provides a much more natural experience viewing and annotating PDF files. As well as has the added benefit of removing the slow and fragile conversion process.

Written by Chris Kellendonk

October 3rd, 2014 at 10:29 am

Status Report for Sept 26th

without comments

Chris

Last Week:

  • Attended the Code Sprint in Toronto!
  • Submitted pull request for rspec tests.
  • Worked on the CSV large file upload issue (#1766).
  • Started researching pdf annotation improvements.

This Week:

  • We were going to try and setup a VM similar to the production server so that the CSV issue and be replicated and logged. When that is complete I will continue trying to resolve this issue.
  • Write a blog post regarding the state of web annotations on PDF’s.
  • Create prototypes of the PDF annotation feature with PDF.js to determine the feasibility of a new annotation system.

Jakub

Last Week:

  • Attended Code Sprint
  • Fixed issue #1768 (API for adding users doesn’t work for REMOTE_USER_AUTH)
  • Fixed issue #1718 (Submissions table missing asset)

This Week:

  • In the process of becoming an rspec master.
  • Started translating the assignment rake test to an rspec test.
  • Also thoroughly going though the assignment model logic itself; added association options and attribute contraints

Yusi

Last Week:

  • Attended Code Sprint
  • Fixed issue #1714 (“Reset API Key” button causes help text to show )
  • Fixed issue #1655 (Adding two flexible criteria *WITH SAME NAME* silently fails)
  • Started Mark model rspec test

This Week:

  • Continue working on Mark model rspec test
  • Make a plan for what need to be changed for the upgrade

Written by Chris Kellendonk

September 26th, 2014 at 11:27 am