MarkUs Blog

MarkUs Developers Blog About Their Project

Archive for March, 2011

Punchlines for March 10

without comments

Danesh Dadachanji
Status:

  • Implemented Update and redid create to work with user.attributesย method rather than the CVS specific method.
  • Posted a review for it.

Next Steps:

  • Make functional tests for API and waiting on the review.

Roadblocks:

  • Assignments are picking up again!

Karel Kahula

Status:

  • Completed unit tests for issue 144.

Next Steps:

  • Figure out which feature from Karen’s list to take on next.

Roadblocks:

  • Having some trouble moving an existing unit test away from fixtures to Machinist.

Misa Sakamoto

Status:

  • got a ship-it!

Next Steps:

  • waiting on Vivien’s code to get a ship-it
  • adding timestamp to requests

Roadblocks:

  • schoolwork =(

Ibrahim Ishahin

Status:

  • Tests for drag and drop done, waiting review
  • Looking at other issues to work on

Next Steps:

  • Testing Framework with Karel or finding a new smaller issue

Roadblocks:

  • Homework ๐Ÿ™

Yansong Zang

Status:

  • Working on the dashboard data task
  • Add a new method in the Assignment model
  • Waiting for response of my review request

Next Steps:

  • Keep working on the task

Roadblocks:

  • None
Bertan Guven
Status:

  • Couldn’t get anything done because of the assignments.

Next Steps:

  • Work on the upload, Make necessary changes on the front end to give the download and upload functionality.,

Roadblocks:

  • Assignments.
Oloruntobi Ogunbiyi
Status:

  • Adding admin authentication to the role switching feature

Next Steps:

  • Implementing the UI login screen for admins to switch between their role and a role with lesser privileges

Roadblock:

  • Assignments and tests.

Written by Tobi

March 10th, 2011 at 1:35 pm

Posted in Uncategorized

Ideas about displaying each Ta’s marking distribution graph

without comments

I just post a review request about my dashboard data task today (8th March). For now I just add a new method tas_grade_distribution_as_percentage in the assignment.rb which is responsible for collecting the data I need to render each ta’s marking distribution. This method is quite similar as the method grade_distribution_as_percentage written by Hora last semester. The next thing I want to do is render each ta’s grade distribution graph using the Bluff.SideBar method (I think Karen said she want the distribution histogram be vertical instead of horizontal. It is easy to change if we use the Bluff.Bar method instead of Bluff.SideBar method in the /app/views/main/_grade_distribution_graph.html.erb, but according to my test the problem is these XX%-XX% will overlap under the graph. So far I have no solution for this problem, so anyone know how to control the performance of these XX%-XX%?)

By reading these lines in our source code:
line 20 to 22 in /app/views/main/index.html.erb

<% @assignments.each do |a| %>
<%= render :partial => "assignment_summary", :locals => { :assignment => a } %>
<% end %>

line 12 to 17 in /app/views/main/_assignment_summary.html.erb

<div class="right">
<%= render :partial => "assignment_info_summary", :locals => { :assignment => assignment } %>
<%= render :partial => "grader_summary", :locals => { :assignment => assignment } %>
<p><%= link_to I18n.t(:refresh_graph), :controller => 'assignments',
:action => 'refresh_graph', :id => assignment.id %></p>
</div>

line 9 to 13 in /app/views/main/_grader_summary.html.erb

<ul>
<% assignment.tas.each do |ta| %>
<li><%= "#{h(ta.first_name)} #{h(ta.last_name)}" %></li>
<% end %>
</ul>

I want to change each of these tas’ names (<%= "#{h(ta.first_name)} #{h(ta.last_name)}" %>) to something like the link “Refresh the graph” (<%= link_to I18n.t(:refresh_graph), :controller => ‘assignments’, :action => ‘refresh_graph’, :id => assignment.id %>). I see here the link call the method refresh_graph in assignments_controller.rb and I will make the link corresponds to each ta’s name call a different method (which I haven’t written yet ๐Ÿ˜‰ ).

The method refresh_grade_distribution which is defined in the assignment_stat.rb are called in only two places:
* line 414 in assignments_controller.rb by method refresh_graph
* line 136 in results_controller.rb by method update_marking_state
I see the method refresh_grade_distribution is responsible for updating the cached grade distribution, so I think I need to write a similar method to update the cached grade distribution of each ta.

Now let me express my ideas in a more precise way:
* Add a method refresh_ta_graph which takes assignment.id and ta.id as input and call this method in /app/views/main/_grader_summary.html.erb like

<ul>
<% assignment.tas.each do |ta| %>
<li><%= link_to "#{h(ta.first_name)} #{h(ta.last_name)}", :controller => 'assignments', :action => 'refresh_ta_graph', :ids => { :a_id => assignment.id, t_id => ta.id } %></li>
<% end %>
</ul>

* Add a method refresh_ta_grade_distribution in assignment_stat.rb which takes ta.id as input and call this method in two places:
– method refresh_ta_graph in assignments_controller.rb
– method update_marking_state in results_controller.rb

* Add a method ta_grade_distribution_array in assignment_stat.rb which takes ta.id as input and returns an array containing the corresponding ta’s grade distribution as percentage used by Bluff to draw the graphs.
I see in the line 25 to 28 of /app/views/main/_grade_distribution_graph.html.erb the assignment.assignment_stat.grade_distribution_array is used to build the graph. But I wonder whether the array returned by the method ta_grade_distribution_array can also be used in the same way as this graph will be rendered only if the instructor click the link of a ta’s name.

Above are all my ideas so far, I want to check with other group members whether it is OK before I do the coding. If anything went wrong please reply in the comment ๐Ÿ™‚

Written by Yansong

March 8th, 2011 at 10:26 pm

Posted in Uncategorized

MarkUs 0.9.5 is out

without comments

We are pleased to announce another bug-fix release: MarkUs 0.9.5.

In addition to all fixes which went into our 0.9.4 release, 0.9.5 solves the problem of not being able to delete a required assignment file. More info in our Changelog.

Grab our 0.9.5 release tarball from our website or patch your MarkUs 0.9.4 using the 0.9.5 patch.

Many thanks to everyone making this release possible. Keep up the good work!

Written by Severin

March 3rd, 2011 at 11:40 pm

Posted in Uncategorized

Minutes for IRC Meeting held on 3rd March, 2011

without comments

Karen and Mike have been talking with Yansong about how to find data needed for the graphs he is trying to produce.
Ibrahim finished the drag and drop feature however the tests are taking a while to do. After adding the position column, Ibrahim gets errors in tests for GradeEntryItems. The error is ActiveRecord::RecordInvalid: Validation failed: Position is not a number for GradeEntryItems.

Severin and Karen didn’t like that the traffic on the mailing list is low however, they like that the IRC channel is busy
Karen prefers that we (the developers) use the mailing list more often because it is easier to track issues being discussed over the mailing list than over the IRC channel.

Karel has been making tests for Issue 144 and intends to submit a review request before the end of the weekend.
Karen will like Karel to pick a small issue to tackle next instead of working on the test framework.

Bertan has started writing up the download part of the yml. However, he has been having problems with Rails.
So far he is able to get data off the database and convert it to yml format. Bertan will be talking to Evan Browning
to get some help.
Side Note: Bertan found RubyOnRails IRC channel to be very helpful with getting Ruby on Rails-related help.
Tobi has drafted the requirements and implementation ideas of the Role Swithching feature. He has started the coding,
however, he has been having challenges with Rails sessions. He will be going to see Karen before the end of the week
to get her opinion on the requirements and implementation ideas of the Role Switching feature.

Danesh has finished creating the HTTP POST request. He made sure he checked all 3 user classes to ensure a typo does not lead to the default of a Student class. For the delete request, Severin recommended he uses a 404 error and pretend the page does not exist.
He will be working on the update request henceforth.

Written by Tobi

March 3rd, 2011 at 5:07 pm

Posted in Uncategorized

Proposed implementation of Role Switching Feature

with one comment

DESCRIPTION

The role switching feature will give administrators the ability to assume roles of students or graders and view their profiles exactly as it will be seen by these users.

-Administrators will have the privilege of editing and modifying student and grader profiles.

-Administrators cannot assume the role of different admin users

-Administrators will have to type their password to be authenticated before they can switch either from their role to one with “lesser privileges” (student, grader) or from a role with “lesser privileges” back to their original role. This is to ensure security.

-The actions that administrators carried out on assuming other roles should be logged

IMPLEMENTATION

With help from Severin’s previous post on role switching implementation, here my proposed solution

Main terms are real_user and effective_user. real_user stands for the original administrator who is assuming the role of some other user. effective_user represents the user that the administrator is currently logged in as (this field could either represent the admin, grader or student).

Implementation Ideas And Code:

1 ย ย  Add fields “real_user” and “effective_user” to the user model. Both fields are nil by default.

Code: To be added

2ย ย ย  Modify the “current_user” method (lib/session_handler.rb) so that it returns the id of field of “effective_user” if it is not nil.

Code: To be added

3 ย ย  Modify the logout/currently logged in user area so that it shows the “real_user” as logged in user and the “effective_user” as the assumed user including a link (call it “exit role”, for example) which allows admins to become their “real_user” again. Current logout link stays as is.

Code: To be added

4ย ย ย  Add views (possibly modal dialogs) and according controllers for role assumption and password prompts prior leaving the “real_user” role and right before getting back to it.

Code: To be added

5 ย ย  Modify the logout controller to erase “real_user” and “effective_user” should they be set.

Code: To be added

Written by Tobi

March 3rd, 2011 at 2:49 pm

Posted in Uncategorized

Punchlines for March 3rd, 2011

without comments

Oloruntobi Ogunbiyi

Status:

Roadblocks:

  • Dealing with sessions in Ruby

Next Steps:

  • Implementing the role switching feature after comments have been made about the design

Bertan Guven

Status

  • Writing the download function for the yml
  • I am more familiar with the code now,

Next Steps

  • Have to make sure YAML conversions are precise
  • upload function

Roadblocks:

  • Rails ๐Ÿ™

Misa Sakamato

Status:

  • shipped request tab code
  • added confirmation msg box upon submission to instructor
  • appears to cause a test failure for someone but cannot recreate the failure in my master branch, investigating

Next Steps:

  • investigate mysterious failure (?)
  • get confirmation msg merged to main code
  • get Vivien’s status on her changes to code

Roadblocks:

  • none

Karel Kahula

Status:

  • Writing tests for issue 144.

Next Steps:

  • Have my unit tests reviewed
  • Work with Mr. Shahin on testing framework.

Ibrahim Shahin

Status:
  • Drag and Drop done, trying to get my tests working
Next Steps:
  • Testing Framework with Karel
Roadblocks:
  • Exams and assignments ๐Ÿ™
Danesh Dadachanji
Status:

  • Created a api/users_controller that can be used for users if given the correct HTTP request.
  • Implemented the show and create methods to display user details and create a new user.

Next steps:

  • Implement the update method to allow for modification of first and last name as well as user_name if an additional parameter is given.
  • Write a review for it.

Road blocks:

  • None
Yansong Zang
Status:

  • Trying to understand the relationships among the models in our database, in order to get “which TA gives what mark to a submission of an assignment”
  • With the help of Benjamin and Nelle this Tuesday I have narrowed things down to understanding the models “Group”, “Grouping”, “FlexibleCriterion”, “RubricCriterion”, and “CriterionTaAssociation”.

Next Step:

  • After got a clearly idea where the data (here the data have four factors: assignment, submission, ta, and result) I want lies in our database I need to find a proper place and data structure to collect and store these data for rendering.

Road Blocks:

  • Still need some help for understanding our database and the models I listed above and I will ask several questions on this week’s IRC meeting ๐Ÿ˜‰

Written by BertanGuven

March 3rd, 2011 at 3:16 am

Posted in Uncategorized

Seeking for help on the Dashboard Task

with 2 comments

These days I am trying to do some coding on showing TA’s marking distribution. But I find that after reading through part of our codebase carefully I got more questions than ideas about the implementation. So I decide to post this blog listing all my thinkings so far and seeking for help from yours ๐Ÿ˜‰

Following are the code files I read through in detail which I think is highly related to my topic:
* app/models/assignment.rb
* app/models/assignment_stat.rb
* app/models/flexible_criterion.rb
* app/models/rubric_criterion.rb
* app/models/criterion_ta_association.rb
* app/models/submission.rb
* app/model/result.rb
* app/model/mark.rb
* app/model/membership.rb
* app/model/group.rb
* app/model/grouping.rb
* app/controllers/results_controller.rb

The first thing that troubled me a lot is the various types of Active Record associations ๐Ÿ™ Fortunately, by reading this page http://guides.rubyonrails.org/association_basics.html I’ve got some basic understandings about all these “belongs_to”, “has_one”, “has_many”, “has_many :through” and so on. Then by reading this graph https://github.com/MarkUsProject/Markus/wiki/database_20101001.png I got a general idea about how our database works but it’s still not very clear. I need some more help to understand the relationships between these models, especially:
* Assignment
* Submission
* Result
* Mark
* Grouping
* Group
Basically, on the topmost level I want to find some relationships between the *result of each submission of an assignment* and *the TA who gives this mark*. Although I know the meaning of these “belongs_to”, “has_one”, “has_many”, “has_many :through” and so on, I got stuck when I want to use these associations between Active Record models to get what I want. So, anybody help? ๐Ÿ˜‰

Here I pick and list some lines out of our codebase:

* app/models/assignment.rb

has_many :rubric_criteria, :class_name => "RubricCriterion",:order => :position
has_many :flexible_criteria, :class_name => "FlexibleCriterion",:order => :position
...
has_many :criterion_ta_associations
...
has_many :groupings
has_many :ta_memberships, :class_name => "TaMembership", :through => :groupings
...
has_many :submissions, :through => :groupings
has_many :groups, :through => :groupings
...
has_one :assignment_stat

* app/model/result.rb

belongs_to :submission
has_many :marks
has_many :extra_marks
has_one :remarked_submission, :foreign_key => :remark_result_id

* app/models/submission.rb

belongs_to :grouping
has_one :result, :dependent => :destroy
...

* app/model/ta.rb

has_many :criterion_ta_associations, :dependent => :delete_all

* app/models/criterion_ta_association.rb

belongs_to :ta
belongs_to :criterion, :polymorphic => true
belongs_to :assignment

* app/models/flexible_criterion.rb

belongs_to :assignment, :counter_cache => true
has_many :marks, :as => :markable, :dependent => :destroy
has_many :criterion_ta_associations, :as => :criterion, :dependent => :destroy
has_many :tas, :through => :criterion_ta_associations

* app/models/rubric_criterion.rb

belongs_to :assignment, :counter_cache => true
has_many :marks, :as => :markable, :dependent => :destroy
has_many :criterion_ta_associations, :as => :criterion, :dependent => :destroy
has_many :tas, :through => :criterion_ta_associations

Above are all my thinkings about the associations between our models, and then I want to talk something about the results_controller.rb.

I think the edit method is where the TA gives a mark to a submission, also I’m not quite understand how these two methods work which are set_released_to_students and update_mark. I believe fully understand these three methods will help me a lot on my task, so can anyone help me here? ๐Ÿ™‚

Moreover I see in the results_controller.rb the method current_user which is defined in app/helpers/main_helper.rb is called in many places. Basically, the major thing I want to do in the results_controller.rb is collect the data about which TA gives what mark to a submission of an assignment. I think results_controller.rb is the best place where I can get all these factors at the same time. The idea is I can get the user_id of the TA by calling current_user and get the submission and assignment in the similar way in the edit method (line 24 to 27 in results_controller.rb). Although I see the edit method (line 47) set the mark, I got a question about how I can get the mark of a submission?

I don’t know whether my thinkings above are exactly right. But assuming they are right and suppose I have got all these things I want in hand. The next thing I want to do is construct a data structure to store these information. For now the best way I can figure out is introduce a hash as a member variable for the assignment model which keep the submission_id as keys and ta_id with corresponding marks as values. I don’t know whether it’s a proper way to do this and I have no idea where should I construct this hash. Should I introduce a new model like assignment_stat or just do it in the assignment_stat model or define a new method in the results_controller.rb to collect these information in the hash? I’m looking forward for some comments on this and really appreciate for your helps ๐Ÿ™‚

Written by Yansong

March 1st, 2011 at 4:49 pm

Posted in Uncategorized