Skip to content

Commit 7cdcfc4

Browse files
authored
docs: add warning about incorrect zipping and instructions (#333)
Add warning about incorrect zipping and instructions
1 parent 9fa5d02 commit 7cdcfc4

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

docs/index.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,59 @@ Download [python_lib.zip](https://github.com/mitodl/mitx-grading-library/raw/mas
7777

7878
The basic idea of this library is that it contains a number of classes that can be used as the check function for an edX custom response problem. Different classes of grader are used for different inputs. We begin by presenting a brief overview on how the grading classes are used in general.
7979

80+
### How to Zip Correctly
81+
82+
EdX expects packages to be at the top level of the ZIP file. If you zip an entire folder named `python_lib`, the paths end up as `python_lib/mitxgraders/`, `python_lib/voluptuous/`, etc., and edX will fail to locate them.
83+
84+
#### Option A (Command Line)
85+
86+
1. Go *inside* your local `python_lib` folder that holds `mitxgraders/`, `voluptuous/`, etc.
87+
2. Run:
88+
```bash
89+
zip -r ../python_lib.zip *
90+
```
91+
This ensures the zip file contains only the contents of `python_lib/` at the top level.
92+
93+
#### Option B (Windows Explorer)
94+
95+
1. Open the `python_lib` folder in File Explorer.
96+
2. Select **all** its contents (e.g. `mitxgraders`, `voluptuous`, etc.).
97+
3. **Right-click****Send to****Compressed (zipped) folder**.
98+
4. Name the resulting zip file `python_lib.zip`.
99+
- Do **not** right-click on the `python_lib` folder itself; you want to zip just its **contents**.
100+
101+
#### Option C (macOS Finder)
102+
103+
1. Open the `python_lib` folder in Finder.
104+
2. Select **all** its contents.
105+
3. **Right-click** (or Control-click) → **Compress X Items** (where X is the number of selected items).
106+
4. Rename the resulting `Archive.zip` file to `python_lib.zip`.
107+
- Again, ensure you’re zipping the *contents* rather than the entire `python_lib` folder.
108+
109+
### Checking Your Zip File
110+
111+
1. **Rename and Unzip**
112+
- Rename your `python_lib.zip` to `test.zip`.
113+
- Unzip `test.zip` into a folder named `test`.
114+
- If you see a folder `python_lib` inside `test`, you zipped incorrectly.
115+
- If you see folders like `mitxgraders/` or `voluptuous/` directly inside `test`, the zip is correct.
116+
117+
2. **Using a Command (Optional)**
118+
- If you have a command line available, run:
119+
```bash
120+
zipinfo python_lib.zip
121+
```
122+
- **Incorrect** (extra directory):
123+
```
124+
python_lib/
125+
python_lib/mitxgraders/
126+
python_lib/voluptuous/
127+
```
128+
- **Correct** (no extra folder at the top):
129+
```
130+
mitxgraders/
131+
voluptuous/
132+
```
80133

81134
## Grading Classes
82135

0 commit comments

Comments
 (0)