Archive for the ‘Developer Essentials’ Category
- 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.
- Begin adding annotations.
- Rewrote Assignment#group_assignment?
- Increased code coverage by creating new test
- Migrated some rake tests over
- Continue test migration
- Spent considerable amount of time troubleshooting a failing test I wrote
- Ran test one by one /test/unit directory (model tests) and fixed test errors
- Fix test errors under /test/functional directory (controller)
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)
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 Submissions View:
Individual Submission View:
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.
- 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.
- 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.
- 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)
- Continue to implement the dashboard. Next I will need to implement the functionality t hat determines which assignment to display.
- 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
- 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.
- converting repo browser table to React
- finish converting repo browser table to React
- UI Fixes with the PDF viewer.
- Very busy week so not as much work was completed as I would have liked.
- Complete PDF.JS UI so that the viewer does not interfere with the page.
- Work on front end annotation system.
- Pushed updated rspec tests from previous week
- Did not have much time to work on more testing due to other assignments and midterm
- Move more tests over
- Make up last weeks work
- 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)
- 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
- 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)
- continue implementation of new design
- commit phase one
- 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!
- I hope to have the majority of the rake Assignment test both reviewed and ported over by the end of the week.
- I was able to get the PDF.js viewer is in MarkUs, and can view, and control zoom on PDFs.
- Finish some implementation details and cleanup code with the viewer.
- Fix styling problems with the viewer in MarkUs.
- 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.
- Eliminate more deprecation warnings and errors.
- 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.
- Wasn’t able to work on the CSV upload problem because the VM still needs to be configured fully.
- Complete integration of the viewer into the page.
- Plan and start implementing annotations.
- 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
- An error related to Active Record appears When log in as admin. The error disappeared when i switched back to rails 3.
Fix Deprecation warnings and errors.
- pushed rspec tests for the Assignment model’s associations and attributes
- Learned more rspec for the next tests I will write.
- Test the Assignment model methods and carry over existing tests from rake test.
- Researched and created a blog post outlining the feasibility of PDF.js
- Made some prototypes to prove PDF.js could work for annotations.
- Not much documentation outlining the actual PDF.js API so a lot of reverse engineering of the code needed to be done.
- Start implementing PDF.js annotation system.
- Continue work on CSV upload problem.
- 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.
- Start working on the upgrade by following checklist in the upgrade guide.
- Find new issue to fix.
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.
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.
- 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.
- 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.
- 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.
- 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.
- Attended Code Sprint
- Fixed issue #1768 (API for adding users doesn’t work for REMOTE_USER_AUTH)
- Fixed issue #1718 (Submissions table missing asset)
- 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
- 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
- Continue working on Mark model rspec test
- Make a plan for what need to be changed for the upgrade