MarkUs Blog

MarkUs Developers Blog About Their Project

Archive for the ‘single table inheritance’ tag

Meeting Minutes: March 5, 2010

with one comment

Brian Xu

  • There’s a question about refactoring the FlexibleCriteria treatment to avoid if “rubric”/else statements.  Karen suggests that, since it’s a relatively complicated question, it be deferred to the end of the meeting
  • Uploaded some new screenshots to ReviewBoard to display FlexibleCriteria functionality
  • For FlexibleCriteria, a valid mark x is a float/integer where 0<=x<=max
  • Victoria should play with the new FlexibleCriteria interface when it’s added to ReviewBoard, to give her input

Bryan Shen

  • Karen thanks Bryan for his help with the dropdown problem experienced at UWaterloo
  • Has been writing tests for FlexibleCriteria – ran into a problem with lots of repeated code
  • Found an elegant solution to the above problem after posting a question on StackOverflow
  • Will work on mapping TAs to marking scheme elements after finishing FlexibleCriteria
  • Mike notes that, realistically speaking, work on mapping TAs to marking scheme elements will probably not get too far before term ends – should focus on foundation work and documentation for next developers to work on it
  • Karen will get the specs for mapping TAs to marking scheme elements to Bryan sometime this weekend

Farah Juma

  • The student interface for the GradeEntryForms is in pretty good shape now
  • Just needs to add ability to release/unrelease marks, CSV upload/download, and tests
  • Mike and Karen want a sneak preview so they can try it out

Joseph Mate

  • Has put up a review request to switch submissions table from AJAX to server-side paginate
  • Did some review requests, and wrote a blog post
  • Next steps include testing, cleaning up the code to take advantage of will_paginate, possibly moving GradeEntryForm to server-side paginate, and getting the detailed submissions table view working again
  • Mike notes that the old functions for the detailed table should still exist, and that getting it going again should (hopefully) not be too hard

Robert Burke

  • Is putting test conversion to Shoulda off to one-side – taking longer than expected (has to rewrite many tests from scratch), and wants to focus on Notables instead
  • Mike notes that it’d be a good general rule of thumb to avoid writing any new tests with Fixtures, but that converting old tests from Fixtures is a task that can be put off for a little while

Karen Reid

  • Checks to ensure that everybody got their midterm report up on UCOSP blog
  • Thanks to everybody who helped out with UWaterloo bugs this week!
  • Classes at UofT end on April 1st.  End on April 5th for UWaterloo, and April 16 for SFU.
  • Karen expects 4 more weeks of work from each team member, but is happy to see it stretch into April if needs be (marks will be sent to schools by end of April)
  • Soft end-date for work is April 1st.  Brian Xu, Bryan Shen, and Robert Burke might continue working.
  • Byron (UWaterloo) is coming to UofT on April 9th to discuss MarkUs plans – all are invited to attend

Brian Xu’s Database Question

  • Original proposals for FlexibleCriteria from Laval students
  • Brian explains the current situation:  In its current implementation, a method “get_criteria” has been added to Assignment model to retrieve collection of criteria (either Flexible or Rubric)
  • Mike thinks it’d be a good idea to try to merge Flexible and Rubric tables into a single Criteria table, and then use Single Table Inheritance to let Assignments / Grader View / View Marks views be ignorant of which marking scheme is being used
  • We are unable to find a scenario which breaks this model
  • The design plan is approved – but delayed until the summer.  Brian Xu / Bryan Shen will continue developing so as to only support Rubric and Flexible Criteria.  Refactoring will happen afterwards.

Written by m_conley

March 6th, 2010 at 1:03 pm

Single Table Inheritance, and Testing Fixtures

without comments

I’m still trying to get our unit tests up and running, and I ran into a snag a few hours ago.

I tried to run a single unit test, on the Admin model (which is a subclass of type User). I kept getting this error message:


ActiveRecord::StatementInvalid: PGError: ERROR: relation "students" does not exist
: DELETE FROM "students"

Hrmph. We don’t have a “students” table, so of course that won’t work. We have Students (which, like Admins, subclass from User), but we certainly don’t have a “students” table.

So how come it’s trying to access that table?

It turns out that Rails test fixtures don’t deal with Single Table Inheritance. Instead, a Rails fixture should be a YAML file that populates a particular table with its contents.

And it turns out I had a fixture called “students.yml” in my test/fixtures folder. So, Rails tried to connect to the “students” table, insert some records, and clear them out afterwards.

The solution was to remove the students.yml, tas.yml, and admins.yml files, and simply have a users.yml file. The same goes for student_memberships.yml and ta_memberships.yml. Replace those with memberships.yml. Boom. Tests run.

Now it’s just a matter of getting some good content in the fixtures, and getting some solid tests written…

Written by m_conley

May 26th, 2009 at 1:54 pm