MarkUs Blog

MarkUs Developers Blog About Their Project

Archive for March, 2012

Punchlines – 03/12/12

without comments

Camille

Status:

  • Continued redacting the final report

Next Steps:

  • Keeping on redacting the final report

Roadblocks:

  • None!

Nicolas

Status:

  • Implemented the patch for the “collecting a particular submission” bug
  • Pull request #706 [PDF conversion patch + Collect a submission patch]

Next Steps:

  • Responding to the various comments on the pull request

Roadblocks:

  • None!

Written by nbouillon

March 12th, 2012 at 5:38 pm

Posted in Uncategorized

Rails named routes

with one comment

For a few of the issues I have dealt with now, I came across the *_path() routes and found out how essential it is to understand how the named routes are generated when it comes fixing routing issues. Rails generates these methods automatically when you add an action to a particular resource. So when you add “get ‘add note’ ” under the notes resource in the routes.rb file, it creates two types of methods (_path() and _url()) for generating URLs.

The distinction between the two methods is that _path() generates a relative URL while _url() generates an absolute URL. So for example: “add_note_notes_path()“ would generate a relative URL of this form: “/en/notes/add_note” while “add_note_notes_url()“ would generate an absolute URL of this form: “http://localhost:3000/en/notes/add_note”.

The following is the syntax for generating a relative or an absolute URL: <action_name>_<controller_name>_<path | url>().  The parameters are passed into the path call as a list of hash values like this: *_path(:id => <value>, :method => <value>,…).

There are two ways to make sure that proper syntax is followed to generate a certain URL for an action. First one is to run “bundle exec rake routes > some_file.txt“. This command is probably the best way to look for a _path() or _url() method. The command outputs the proper method to use for each action declared in routes.rb file. This is how each action is displayed when the command is run:

add_note_notes GET    /notes/add_note(.:format)    {:action=>”add_note”, :controller=>”notes”}

So, by adding _path() or _url() at the end of ‘add_note_notes’ should give you the relative/absolute link you’re looking for. The second method to use is to confirm that the method you come up with actually does return a proper path. This can be done by using the debugger. Add <%debugger%> in the view file that you want to use the method in. In the debugger, type: “p <method>“. This will return the URL if the method exists otherwise, it returns an error. In the case of an error, the most likely case is that the controller name needs to be rechecked to see if that’s the controller which defines the action. In many cases, there’re multiple controllers needed for an action, in which case the method needs to have that controller name in there. For example, if you look at the action, invalid_grouping, the auto generated method is: “invalid_grouping_assignment_groups_path()” but the route is declared under the resource :groups. This is because invalid_grouping action can be applied to a collection of groups for a particular assignment.

In conclusion, when in doubt, use the “bundle exec rake routes“ and the debugger in combination to make sure the URL pattern matches the route you want to generate. This may be a bit confusing at the beginning but one of the best ways to understand the concept is to browse through the routes.rb file and observe how the actions are declared. It is also important to read about the routes.rb file if you haven’t done so yet. The link is given below.

http://guides.rubyonrails.org/routing.html

Written by jparekh

March 11th, 2012 at 6:13 pm

Posted in Uncategorized

Punchlines – March 5, 2012

without comments

Hanson: 

Status:

  • Completed the final batch of link_to_remote fixes assigned to me, they are sitting in code review
  • Helped review code where I could

Next Steps:

  • Didn’t have time to write the blog post for link_to vs. button_to 🙁
  • Picked up an issue from GitHub, #691 filed by Egor

Roadblocks:

  • None

Egor:   

Status:

  • opened:  #705,  #691
  • closed: #690
  • Finished my first round of changes for adding an API for assignments. New API routing is done as well as the handling of GET and DELETE requests for the assignments . PUT and POST are left…they are the hard ones. Detailed changelist can be seen at: http://review.markusproject.org/r/1206/ I will need Danesh to help me with this review as Severin is busy this week.
Next Steps:
  • continue working on the assignments API and hopefully get to my next task ( #338 ) if I have time
Roadblocks:
  • Sent a brief email to Severin regarding my HTML 5 validation review from last week and possible ways I could add on to it. Seeing as how he is busy this week, I will sit on this bug for now.

Danesh:

Status:

  • Pushed all the changes that received a ship-it. That is, removing
    unused partials and collecting submissions. Held off on pushing my
    fixes for replacing the prototype helper because I didn’t realize I
    had improperly tested one of them.
  • The link for adding students is dependent on the notes modal being
    fixed, last I checked Jay had not pushed this. I tried pulling his
    branch but git gave me trouble 🙁
  • Worked on pagination links, making them use AJAX once changed to
    link_to, I’m trying to tweak it to be friendly and render a partial
    rather than redirect to a new page.
  • Spent a lot of time helping others, discussing various
    implementations for their bugs/fixes. Also spent a fair bit going
    through code reviews.
Next Steps:
  • Continue with prototype helper replacement.
  • Finish off pagination issues.
  • Start on Bug Viewer UI, I’ll have to see how this modal stuff waves out!
  • Continue with test.
Roadblocks:
  • Git merge woes.

Christine:

Status:

  • Posted fix for #695 to review board. It caused me quite a bit of headache, I didn’t realize that the redirect step advised by articles on cookie detection with Rails was necessary because otherwise the cookies[:key] variable will be set locally. Seems so obvious now that I think back on it.
  • Re-read Ch1-5 in the ROR tutorial, and took notes because the first time through I was so focused on getting the sample_app to work I didn’t commit to memory the concepts that were really being taught.

Next Steps:

  • I could write a blog post on a summary of the important parts of Ch1-5 of the RoR tutorial book, since I took notes. It might be useful for next term students to guide them through the (rather long) tutorial. Also I had some problems with gem versions as used by the RoR book conflicting with the ones used by Markus, I could mention that in the post
  • Continue with issues

Roadblocks:

  • Had a minor eye infection on my right eye, just hurt a bit didn’t really effect work (fingers crossed it doesn’t worsen)

Aimen: 

Status:

  • Currently working on creating filter on tables
  • Was able to add a modal for submission column filter with Sean
  • Wrote a blog about different ways on how a Filter Table Selection could look like

Next Steps:

  • Will work on “Visibility” of the columns
  • Work on User Preferences for the column
  • Write more blogs about the implementation

Roadblocks:

  • Stuck for a while figuring out while the pop up (modal) won’t diaplay, send an email and got few answers

Jay:

Status:

  • Shipped #483, #620
  • Fixed issue #684 and wrote route tests for it
  • Waiting for feedback on #684, #602

Next Steps:

  • Wasn’t able to write a blog this week so will do that for next week
  • Pick a new issue and work on it
Roadblocks:
  • Database stopped working while trying to fix another problem. This
    was finally fixed thanks to Severin and Danesh 🙂

Aaron:

Status:

  • Working on applying some suggested changes to my solution for 298 – modal dialog
  • Halfway done reading through RoR Guide on Active Record Validations and Callbacks for issue 648 – record validation of submission rules

Next Steps:

  • Continue to make progress in the above 2 issues

Roadblocks:

  • Stuck on a ActionView Template Error when trying to apply some suggested style changes to my solution for 298
  • Last week, had interviews, assignments, project milestones and a presentation to do, didn’t get to spend as much time as I wanted on Markus
  • This coming week, I have 2 presentations and another interview to prep for, but looks like an easier week than last

Sky:

Status:

  • Finished reading “Unit Testing of Models” section in book “Agile Web Development with Rails”.
  • Trapped in test fails with which I worked but didn’t figure out; fixed after a new pull from upstream.
  • Added two test cases for unit test on grace day counting.
  • Finished migrating timezone validation to a newly-created validator library, but got about 20 unit test fails. Need to get rid of them.

Next Steps:

  • Added another two test cases on grace day counting.
  • Make validator library pass all tests.
  • Work on a new issue.

Roadblocks:

  • Still struggle with unfamiliar Rail conventions from time to time. Have borrowed the book and started reading.

Tobi:

Status:
  • Implemented issue 339 and fixed the graphs to show up when an admin logs in.
  • Logged and fixed issue 697 and currently writing Unit tests for it
  • Logged issue 704 (thanks to Hanson pointing it out), currently working on it
  • Got a response from the Prototype Devs about the bug I logged but they only redirected me to create an issue on the Github Prototype UJS. I will still log the bug again but not focus primarily on getting help from them
Next Steps:
  • Finalizing the fix for issue 647
  • Writing unit tests for Releasing marks by admins and students viewing the marks
  • Closing issues 339, 697, 647 and 704
Roadblocks:
  • None.

Sean:

Status:
  • Worked all day on Saturday with Aimen K. on issue 689.
  • Finished a fix for issue 651 – ready for review
  • Finished a fix for issue 617 – ready for review
  • Got help from Danesh D. with some environment issues at the start of the week.
Next Steps:
  • Post issue 651 and 617 to reviewboard
  • Continue working on 689 with Aimen K.
  • Take a new issue to work on
Roadblocks:
  • Worked through some troubles with GIT
  • Need to figure out posting to reviewboard
  • Need to keep learning more about Rails, Javascript

 

Written by hwu

March 5th, 2012 at 8:13 pm

Posted in Uncategorized

Punchlines – 03/05/12

without comments

Sébastien

Status:

– Rewritting of the book of specifications to take into accounts M.Magnin’s remarks regarding the user interface.

Road Blocks:

– Failed to implement B.Thorent’s code from last year because it was using a too old version of Markus.

– Waiting to see if we focus on coding an interface or interviewing the teachers to design a better one.

Next Steps:

– Build a simple interface to launch a plagiarism detection

Marc

Status:

– Rewritting of the version 4 of the book of specifications taking into accounts remarks of N. Varoquaux, B.Vialle and M.Magnin.

Road Blocks:

– Waiting for the response of M.Magnin to know if we have to focus on the development or on the customer needs.

Next Steps:

– Finalization of the book of specifications

 

Written by mlaurent

March 5th, 2012 at 1:44 pm

Posted in Uncategorized

Punchlines – 03/05/12

without comments

Camille

Status:

  • Continued redacting the final report;
  • Submitted its plan to our supervisors;
  • Also submitted to Guillaume Moreau a document summing up our before/after test results.

Next Steps:

  • Keeping on redacting the final report

Roadblocks:

  • None!

Nicolas

Status:

  • Investigated the problem on collecting a particular submission.
  • No significant result…

Next Steps:

  • Investigating the problem on collecting a particular submission.

 

Written by nbouillon

March 5th, 2012 at 10:21 am

Posted in Uncategorized

Hide/ Show Columns for Tables

with one comment

So in my opinion to show / hide columns we can go about it in 2 ways. We can either have a drop down menu or a Pop up that shows different check boxes and you can select it.

 

 

In the headings row we can have a pencil icon at the end of the row and after clicking it, it can either give a drop down or a pop up.

 

A pop up would look something like this

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A drop down Menu would be something like how they have it in the Review Board

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Personally I like a pop up better. But I am open to all opinions or if you have any other ways you would like to implement. Please comment away.

Written by akhan

March 3rd, 2012 at 2:40 pm

Posted in Uncategorized