User:Ashah22

From Expertiza_Wiki
Revision as of 23:40, 26 October 2017 by Ashah22 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

Expertiza is a web application developed using Ruby on Rails that serves as a peer-review system. The application allows students to submit and peer-review learning objects (articles, code, web sites, etc)[1][2]. It is an open source project and it's codebase is maintained in GitHub. We are contributing to Expertiza as a part of our Object-Oriented Design and Development's Open-Source Software (OSS) Project. Our goal in this project is to fix various issues related to staggered deadlines for assignments. A staggered-deadline assignment is an assignment in which different topics have different deadlines. In this Wiki Page, we will explain the changes that we have made for the same.

Changes To Be Implemented

  • Currently, the system requires the instructor to enter, manually, all submission and review deadlines for all topics. It would be better if the instructor could enter the deadlines once, and have them be applied to a specified set of topics.
  • We were also asked to create a "Duplicate Topic" button for the instructor, to copy a particular topic within a assignment.
  • Fix issue #1008: A student is able to signup for a topic in an assignment only if the assignment due dates are in the future. Thus if the topic deadline is in the future, a student should be able to signup for a topic irrespective of the assignment deadline.

    Modified Files

    1) app/controllers/sign_up_sheet_controller.rb

    2) app/views/sign_up_sheet/_due_dates.html.erb

    3) app/helpers/sign_up_sheet_helper.rb

    4) app/views/layouts/application.html.erb

    5) app/views/sign_up_sheet/_all_actions.html.erb

    6) app/views/sign_up_sheet/_add_signup_topics_staggered.html.erb

    7) app/views/sign_up_sheet/_add_signup_topics.html.erb

    Approach Taken To Implement Changes

    1) For the first issue where the instructor was forced to enter due dates manually for each topic, we have added a checkbox against each topic in the assignment. The code for this was added in the due_dates.html.erb file. We have also provided a text box at the end for the instructor to enter the due dates for the selected topics. Then we have updated the save_topic_deadlines method in the sign_up_sheet_controller. This is the method called when we want to save the new deadline entered.

    The logic we have used to modify due_dates.html.erb:

  • Add a checkbox tag before each topic
  • If the checkbox is checked add the topic_id to an array "selected_ids[]"
  • Provide a text box for the instructor to enter the new deadline for the selected topics.
  • Call the save_topic_deadlines controller method with this array and entered date as parameters

    The logic used to modify save_topic_deadlines:
  • Receive the array and dates from the view
  • Check if array is empty
  • If not, loop over each of the topic using the ids from the selected_ids[] array and assign the new deadline to each of the topics

    2) Along with the check-boxes, we have also implemented shift+click for topic selection. Without it the instructor would have to select each topic individually. Thus with this, if the instructor selects a single topic, then presses shift and selects another topic, then all the intermediate topics will also be selected. This saves the instructor the hassle of going and explicitly selecting each topic.
    This is achieved using a javascript written in the due_dates.html.erb.
    The logic is:
  • Get the checkbox selected by the instructor
  • If shift key was pressed, get the last checked checkbox.
  • Loop over each checkbox between the two checkboxes and change the status of each checkbox to selected.

    3) We have also sorted the topics that are displayed for the assignment based on the topic_identifier. Managing a number of topics which are all out of order can be troublesome. Currently the topics are displayed in the order in which they were created. Say the instructor first creates a topic with identifier "4.1". Second s/he creates another topic with identifier "1.2". Intuitively the newer topic must be displayed first. This is not the case in the current version. Thus we have added that.
    This is achieved by adding a simple line to the views of the topics. (i.e add_signup_topics_staggered.html.erb and add_signup_topics.html.erb)
    <% @sign_up_topics = SignUpTopic.where(['assignment_id = ?', @assignment.id]).order(:topic_identifier) %>

    We use the inbuilt method .order with the parameter :topic_identifier.


    4) To implement "duplicate topic" button, we have added the button under the actions menu for each topic in the sign_up_sheet/_all_actions.html.erb view file.
    We have taken the following design decisions regarding the duplication of topics:
    -> If all the slots are available for the particular topic, then instead of duplicating a topic, the instructor can just extend the deadline and allow students to signup.
    -> If no slots are available, then the instructor will first have to increase the number of slots and then try again.

    To implement this logic we have added a new method in the sign_up_sheet_controller.
    The method duplicates the topic using the following logic:

  • Find the topic using the topic_id that we sent from the view.
  • Create a new dup_topic. Set the various parameters of the dup_topic (identifier, assignment_id, link, description etc) to their corresponding values from the original topic.
  • The remaining parameters are assigned with some modifications. The name is saved with the word " copy" appended at the end. The number of max_choosers for this duplicate topic is equal to the available slots for the original topic.
  • Before saving the new duplicate topic, we check for the above mentioned conditions. If all the slots are available or none are available, we do not save the topic and display an error message.
  • If both these conditions are not passed, i.e available slots<max_choosers (for the original topic), then we save the duplicate topic.