CSC/ECE 517 Fall 2019 - E1964. Export review scores for projects: Difference between revisions
Line 103: | Line 103: | ||
} | } | ||
</pre> | </pre> | ||
The output file has name, unity_id, email_id, grade and comment. | |||
[[File:Csv_view.png]] | [[File:Csv_view.png]] |
Revision as of 22:53, 28 October 2019
E1964. Export review scores for projects
This page provides a description of the Expertiza website(1) project undertaken for OSS component in Object Oriented Design and Development.
About Expertiza
Expertiza GitHub source code(2) is an Open Source project based on Ruby on Rails framework. It is a software to create renewable learning projects through peer reviews and continuous assessments. It enables group projects and project submissions via URLs and wiki pages as well. It is supported by the National Science Foundation.
Problem Statement / Motivation
This project aims to easily handle review score exporting for instructor and TAs, when they try to export scores from Expertiza to WebAssign website(3). Currently, no such option exists to export scores so that it can be later uploaded to WebAssign efficiently.
TODO:
Tasks Identified
All tasks pertaining to the completion of the project have been listed out here as follows:
- A new button is to be added to export scores. All functionality to be handled will be taken care of using VanillaJS.
- TODO
- Files modified:
_review_report.html.erb
Implementation
TODO:
- Diagrammatic representation
<button onclick="exportTableToCSV('review_scores.csv')">Export Review Scores To CSV File</button> <br /> <br /> . . . <td> <%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user => {:name => user.name(session[:ip])}), :method => :post, :class => "runityID" %> (<span class="rname"><%= user.fullname(session[:ip]) %></span>) </td>
Screencast
- Here is the link to a screen recording on how to access the functionality and export the CSV file.
Code and Snapshots
We have written two methods inside _review_report.html.erb named exportTableToCSV and downloadCSV which are as follows:
function downloadCSV(csv, filename) { var csvFile; var downloadLink; // CSV file csvFile = new Blob([csv], {type: "text/csv"}); // Download link downloadLink = document.createElement("a"); // File name downloadLink.download = filename; // Create a link to the file downloadLink.href = window.URL.createObjectURL(csvFile); // Hide download link downloadLink.style.display = "none"; // Add the link to DOM document.body.appendChild(downloadLink); // Click download link downloadLink.click(); }
function exportTableToCSV(filename) { var csv = []; var rows = document.querySelector("table#myTable").rows; var row = []; row = setHeaderForCSV(); csv.push(row.join(",")); for (var i = 1; i < rows.length; i++) { var row = []; reviewer_name = "\"" + rows[i].querySelector("td span.rname").innerHTML + "\""; reviewer_unityid = rows[i].querySelector("td a.runityID").innerHTML; reviewer_emailid = reviewer_unityid + "@ncsu.edu"; reviewer_grade = rows[i].querySelector("input#grade_for_reviewer").value; reviewer_comment = "\"" + rows[i].querySelector("textarea#comment_for_reviewer").innerHTML.replace(/"/g,"\'") + "\""; row.push(reviewer_name); row.push(reviewer_unityid); row.push(reviewer_emailid); row.push(reviewer_grade); row.push(reviewer_comment); csv.push(row.join(",")); } // Call Download CSV file function here downloadCSV(csv.join("\n"), filename); }
The output file has name, unity_id, email_id, grade and comment.
Test
TODO: Rspec test cases were written with the help of Cucumber and Capybara.
Design
The aim of our project was to implement exporting of review scores from Expertiza software. To accomplish this, we shall advance by using the delegation pattern to add exporting capabilities to the " <TODO:> export file controller " for exporting review scores.
Team
Mentor: Harsh Agrawal
Team:
- Yash Thakkar (yrthakka)
- Pururaj Dave (pdave2)
- Maharshi Parekh (mgparekh)
References
TODO: Add all references by number.