Table of Contents

Task Set 4

For the final tasks of this project, we want to merge the information about students' class situation from the 3 tables (lecture, exam, homework) !!! Please add links to csvs!!! . The issue with joining these 3 tables is that table lecture_grades is mapped using students' emails, whereas the other 2 tables are mapped using students' names.

Fortunately, we have another table, email_map, that maps students' names to their emails. The bad news is that this table contains typos.

Your job is to fix the typos in email_map table, generate the correct table and then use that to join the information about students' lecture, exam and homework grades.

Typos (0.5p)

Column Name from table email_map contains typos. Example: Zane Kayle is misspelled as Zan Kayle or Amelia Caden is misspelled as Amelia Camdden. Fortunately, the name Zane Kayle contains only a few misspelled letters and it is guaranteed to appear in the correct form, in the name column of the exam or homework tables. Hence, we can use the latter names as reference to correct the typos.

The goal is to write function correct_table, which receives the name of the column containing typos, the table containing typos, a reference table (a table where the values from that column are correct, but not necessarily in the same order) and returns the first table where the typos have been fixed. All parameters are strings in CSV-format.

correct_table :: String -> CSV -> CSV -> CSV
-- this will be tested using: correct_table "Nume" email_map_csv hw_grades_csv

So in order to fix the typos, you will use a reference table, where the specified column has correct values.

Timeout

For this task, we will set a timeout of 30 seconds. Your implementation must succeed in that time in order to receive the points. The most time consuming process should be calculating the distance between each value from T and each value from Ref. We suggest Lazy Dynamic Programming.

Note

Project Summary (0.5p)

Note: Task Typos is a prerequisite to this task. You need a correct email_map table in order to implement them.

Grades Table

Now that you can have the correct mapping of each student's name to their email, we can join all tables (hw_grades, lecture_grades, exam_grades). Write function grades:

grades :: CSV -> CSV -> CSV -> CSV -> CSV
-- tested with: grades email_map_csv hw_grades_csv exam_grades_csv lecture_grades_csv

The result will be a table with the following column names: grades_schema = [“Nume”, “Punctaj Teme”, “Punctaj Curs”, “Punctaj Exam”, “Punctaj Total”]. The table is sorted by the first column (column “Nume”).

The formulas for computing each grade are:

The resulting table must be sorted by column “Nume”.

Note

Submit

Deadline: 30.05, 23:50. Vmchecker: TBA.