CSC/ECE 517 Fall 2017/E1767 Improve imports

From Expertiza_Wiki
Revision as of 19:10, 30 October 2017 by Asharm33 (talk | contribs)
Jump to navigation Jump to search

This page deals with issues picked up the project E1767 and the solutions developed. It is based on Expertiza, an open source project.


Introduction

Expertiza is an open source project created using Ruby on Rails. This project is an software primarily to create reusable learning objects through peer review and also supports team projects. <ref> </ref> Expertiza allows the creation of instructors and student accounts. This allows the instructors to post assignments (student learning objects) which can be viewed and worked upon by students. These can also be peer reviewed by students later.<ref> </ref> The Expertiza project is supported by the National Science Foundation. It supports many types of documents, including articles, code, web sites, URLs and wiki pages.

Motivation

Being an open source project, Expertiza is constantly improved. In particular, bugs are often found and resolved. Also new features are often added. The aim of this work is to rectify bugs around the import feature.

Background

As there are many users in the interface, adding several things (for each user) individually and manually will be cumbersome and time consuming. Hence another method is to import things from a file. Several things, like all students from a class, or all teams for a particular project, or even all possible topics for students for a particular assignment/project can be imported from a file. The reason for doing this is that some lists, like the teams students have formed, may not be available online but rather on a sheet of paper the students have filled offline. In addition, a bug on passwords when importing users (like students) will also be looked into.

Problem Statement

  • If no password is present in the password column in the CSV file for an user (while importing a list of users), Expertiza returns an error “each record in the file you are importing does not have enough records”. (Issue 183)
  • There should be an option of importing teams (for a particular project/assignment) from an CSV file. (Issue 153) <ref> </ref>
  • While importing teams, if one (existing) team has the same name as a team being imported, there should be an option of renaming the existing team (Issue 329)
  • There should be the functionality of adding (new) users into an existing assignment team (which may have been formed by one student or an instructor) which does not have maximum strength (Issue 328)
  • There seem to be bugs while importing several (different) files
    • The User Interface for importing different (but related) things like course participant and assignment participant should be similar
    • If one extra column is present in an imported CSV text file, an appropriate message should appear (Issue 52)

Expected functionality (with the issues identified)

  • Users have the choice of the password for their account, including the choice of no password. Thus, while importing a list of users via a CSV text file into Expertiza, the online interface should be able to accept a blank password for any user.
  • The option of importing teams by a text CSV file should be flexible, that is, while importing teams it is not necessary to have the topic assigned to the team (can be assigned later). However the option should be able to import the topic name (if it has already been assigned).
  • No two teams should have the same name. This means if a new team (being imported into the database) and an existing have the same name, there should be an option of changing the name of either one of the two teams.
  • Students (or instructors) should have the option of adding members (who do not have a team yet) to incomplete teams.
  • User Interface for importing (all types) of files should be as similar as possible.


Current Implementation

The following tasks were listed as a requirement, but after careful examination it was determined that these tasks were already implemented

  • The simplest fix: If I try to import topics, the import page gives me this message: “The import process expects the following columns:” but it doesn’t say what the columns are (topic number, topic name, category, number of slots, category)! It used to be in the system; please revert the change to fix this bug. See Issue 719.
  • When teams are imported in order to insert new members, the members are not inserted. See Issue 328.
  • It should be possible to leave off the final fields in a line of a CSV file. These fields are often not specified anyway. For example, if a password isn’t specified when a new user is created, the system generates a password (see Issue 183). When importing topics, topic categories are rarely specified. But if the final field is blank, the import requires the CSV line to end with “, “ (comma and space). This should be fixed for all imports.


Dealing with Issue 153

Files changed

Import_file_controller.rb , models/sign_up_sheet.rb , views/sign_up_sheet/_add_topics.html.erb

Original Functionality

Currently, we cannot import teams from a file. Teams have to be created individually, (by the instructor or a student)

Solution

The solution dealt with adding the feature. This involved adding a method in the model which is showed in the following code fragment:


The other changes are to add the method to an appropriate place in the views and the controller.

Dealing with Issue 329

Files changed

models/team.rb , views/import_file/_start.html.erb

Original Functionality

While importing teams from a file, if a new team name is an exact match with an existing team, then the options for managing the conflict is either ignore (and not add) the new team, or to add the new team with a new name or to delete the old team and to add the new team in it's place.

Solution

The solution dealt with adding the feature. This involved adding a method in the model which is showed in the following code fragment:

Also, the new option must be reflected in the appropriate view:


The other changes are to add the method to an appropriate place in the views and the controller.


Import User Interface Fix

Solution

When importing assignment participants and course participants, the User Interface indicates that there are multiple fields expected. However, in fact, user can only import file with 1 column which is user names. We can expect that the imported users are already in the system (otherwise, there should be an error message). Fixing the User Interface and also the code of importation accordingly.


Export Enhancement (Issue 1079)

Files changed

app/models/assignment_participant.rb, app/models/course_participant.rb, app/models/participant.rb, app/views/export_file/start.html.erb

Original Functionality

Exporting Course Participants and Assignment Participants neither share the same User Interface nor the same code. Assignment Participants used the common User Interface designed for export functionality. Due to this, the export feature of Assignment Participants return blank file.

Solution

Course Participants and Assignment Participants have same User Interface for Export feature as shown in the below image. Course Participants and Assignment Participants are derived from base class named Participants, the export feature can be generalized for both of them by moving it to Participants, which removed redundancy from the code base.

https://github.com/expertiza/expertiza/issues/1079


Export methods added to participants.rb



Team Contact

MEMBERS
Arjun Sharma: asharm33@ncsu.edu
Bikram Singh: bsingh8@ncsu.edu
MENTOR
Yifan Guo: yguo14@ncsu.edu


References

<references/>