Preprocessing files for Graderworks: Converting .rar to .zip

by: Anthony Garland

When students submit several SOLIDWORKS files as part of a single homework assignment or project to the course management system (at Clemson this is currently Blackboard), we require them to submit a .zip file with the files inside. When students are modeling SOLIDWORKS assembly files, this is especially important, since the relative path from the assembly to its part files must remain the same if the assembly file is going to open properly on the instructor's computer. Creating .zip folders is straightforward and easy when using Windows. Right click on the folder, go to 'send to', then ."Compressed (zipped) folder".

However, because Clemson recommends (and installs if a student takes their computer to the IT department) WinRAR, students often convert their folder into a .rar rather than a .zip. Since Graderworks is a .NET application, it can unzip .zip files into folders, but it cannot unrar .rar files. Also, the name of the .rar or .zip file is important to Graderworks because it contains the student's username. So, what are we going to do?

.rar to .zip image

Objective: Convert .rar files to .zip files with the same basename. 

 

Solution

The script used in this solution is found on Github

  1. I installed 7-zip on my computer because it allows you to run the program using command line arguments instead of using the GUI. This ability is important since I want to unrar a large number of files automatically. 
  2. I wrote a PowerShell script to find the .rar files and then call 7zip to unrar them. However, my colleagues are more familiar with Matlab than PowerShell or Python, so I converted the script to Matlab so they can continue to use the script in the future. The script does the following actions:
    • Gets all the files in the target folder using the 'dir' command. Then it uses the 'fileparts' command to help identify the .rar files. 
    • If a .rar file is found, then it puts together the command line arguments for 7zip needed to unrar the file. 
    • Next, it runs 7zip by using the 'system' command in Matlab. This command creates a new folder.
    • Finally, it zips together the new folder using the Matlab 'zip' command which creates a .zip file with the same base name as the original .rar file. 
  3. To use the script, you must modify lines 5 and 8 which are the directory containing the .rar files and the absolute path to 7zip respectively. 

The script works great! Once all everything is converted from .rar to .zip, then we run Graderworks over the student's files .zip files to grade and check for plagiarism. Graderworks will unzip every file into a folder before finding and analyzing every SOLIDWORKS file in the newly created folder. 


Join our free mailing list!

Graderworks

  • Grade student's SOLIDWORKS files quickly
  • Catch Plagiarism
  • Export SOLIDWORKS files to another format in bulk
View Software

Recent Articles

Evaluation of Humans and Software for Grading in an Engineering 3D CAD Course

Anthony Garland and Sarah Grigg published a paper showing the effectiveness of a


New Grading Items in GW 4.07 - 4.30

Gradeworks can help you automated SOLIDWORKS grading. New grading items include:


Graderworks 4.00

We are happy to release Graderworks 4.00. This new version of Graderworks is a c


Graderworks 3.10 Check for Fully Defined Sketches

What's new in Graderworks 3.10? Increased data collection speed. Check for fully


Graderworks 3.00

Graderworks 3.00 has new improvements which help fully automate grading of SOLID


Graderworks: SW 2017, Config files, Command line args

Graderworks 2.36 and higher is compatible with SOLIDWORKS 2017. Graderworks now


Graderworks: An Official SOLIDWORKS Solution Partner

Garland Industries is happy to announce that Graderworks is now an official SOL


Graderworks 2.35

Several more improvements have been made to Graderworks in version 2.35.


Graderworks 2.32 Release

Graderworks 2.32 represents continued incremental improvement in the overall qua


Design Automation Example

A design automation example is given showing topology optimization coupled with


Graderworks 2.31

Graderworks 2.31 includes the following updates. 1. When analyzing .stl files th


Graderworks 2.3 Update

Update on Graderworks 2.3 Several major bugs were fixed.


Graderworks 2.3 Release

Graderworks 2.3 allows you to compare the geometric similarity of .stl files wit


Turnitin vs. Graderworks

Graderworks is the Turnitin of 3D models. Not using a plagiarism checker in a So


Getting Started with Graderworks

This tutorial shows how to get started analyzing and grading Solidworks part fil


The Making of Graderworks Video

As an engineering entrepreneur, marketing is not my strength. To make high-quali


Organizing hundreds of .stl files for 3D printing

How would you 3D print hundreds of .stl files in the shortest time possible usin


What is unique about 3D printing?

3D Printing offers many new exciting possibilities, but why is it unique? Three


How 3D printing works

3D Printing requires three steps. 1. Getting a 3D model. 2. Slicing the model to


Preprocessing files for Graderworks: Converting .rar to .zip

Solidworks students submit .rar files instead of .zip. Graderworks requires .zip


Windows Smart Screen and Code Signing

A short tutorial on how to sign a Windows installer and what the smart screen fi


What should we 3D print?

3D Printing opens the possibility of mass customization of consumer products. Ma


Software, dying on the journey from academic project to commercial tool. 

Does software make it from academic research to useful commercial tools? Ignoran