CSC/ECE 517 Fall 2017/E1763 Fix Staggered-Deadline Assignments

From Expertiza_Wiki
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). 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.
  • Currently the assignment topics are displayed on the basis of "first created". Thus we have to sort the topics sorted based on the topic_identifiers.
  • Testing is not a requirement of this project.

    Motivation

  • Currently when the instructor wants to assign the same deadlines to certain topics, s/he has to manually enter all deadline dates. Each deadline includes date and time. Now if there are review rounds (which we assume there are), the instructor will have to enter all dates manually. This task is time consuming and just wasted effort. It will be more efficient to have a method where the instructor can assign this deadline to certain selected topics from the assignment.
  • In an assignment that has staggered deadlines, say a topic has 3 slots. For the first round only 1 slot was taken. Now in the second round, another team wants to sign-up for the topic. This team will not be allowed since the deadline has already passed, even though slots are available. The solution to this problem is to let the instructor duplicate a topic with remaining slots and set the duplicate topic deadline to the latest deadline of all topics(default) or any date that s/he wants.
  • The current display of topics is not intuitive in the sense that say, topic 1.1.1 was created after topic 2.1. Now the newly created topic (1.1.1) will be displayed after 2.1. Thus, we will display the topics sorted according topic identifier. If a topic is created without identifier it will be displayed before all the topics with identifiers, on the basis of "first created".

    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. This text box is auto-populated with the latest deadline of all topics in that assignment, thereby saving the instructor the hassle of having to enter all the fields from scratch. 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.Also, 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.
  • The default deadline for the textbook is set to the latest deadline among all the topics under the assignment. This is achieved by a helper method
  • 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 of selected topics and new deadline from the view
  • Loop over each of the topic. Assign the new deadline from the text box to the topic that has a selected checkbox

    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 which is not intuitive. 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.
  • Get the available slots fo the topic.
  • Depending on the available slots, if topic is to be duplicated call assign_values method.
  • In the assign_values method, we set the various parameters of the duplicate_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.
  • If the topic is not to be duplicated(if available_slots==0 or available_slots==max_choosers), error out and display appropriate error message.



    Screenshots Of The Implemented Features

    1) Log in as Instructor. On clicking on 'Manage Content' a screen is rendered which lists the existing assignments.
    2) Click on the edit assignment button for any assignment. For the purposes of this screenshots we will select "Madeup problem".
    3) For the first feature we can see that we have added a checkbox against each topic. We can also see the "New deadlines for selected topics" text box. This text box automatically fills the boxes with corresponding values of the topic with the latest deadlines of all topics. All these are clearly visible in the screenshot below.




    4) Since multi-select cannot be shown with images, we have shown it in the screen-cast. In the following couple of screenshots we have selected various topics and entered a new date for all of them only once. When we press the save button the dates entered in the text-box is applied to all the selected topics.





    5) Sorting. From the topics displayed in the image below we clearly see that they are sorted.




    6) The first case is when we try to duplicate a topic with zero slots available. In this case too it will not duplicate a topic and display an error message.




    7) The second case is when we try to duplicate a topic with all slots available. It will not duplicate the topic and display an error message.




    8) Success!!




    Testing

    We have tested these features in the video using the following steps:

    • Login as an instructor since these features will not be available for other user roles.
    • Go to assignments and for a random assignment press the edit button. We have selected "Madeup problem" for our screenshots and videos.
    • Go to topics. You can see the "duplicate topic" button in the action column for all topics.
    • To duplicate a topic press the button for any topic.
    • Depending on the conditions mentions above it will successfully duplicate or it will error out with the appropriate message.
    • For the second feature click on the "Show start/due dates" button at the bottom.
    • Select check-boxes against topics whose deadlines you want to change.
    • To check shift-click functionality select one topic. Press shift and select another topic. All topics in the middle will also be selected.
    • The text box at the bottom has the latest values of all the topics by default.
    • Change the deadlines and click on "Save" button.
    • The entered deadlines are saved for all topics selected.



    Demo Video Link

    Demo Video Link

    Additional Links

    Github Project Repo
    Github Pull Request Project Demo

    References

    Expertiza NCSU

    Team

    Giang Nguyen
    Deepak Kalro
    Aditya Shah