sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

generated notebook above student folder causes nbgrader to fail #4575

Closed DrXyzzy closed 1 week ago

DrXyzzy commented 4 years ago

Reported by Michael Falk.

  1. Create a CoCalc course with at least one student.
  2. Create assignment folder ~/A/A1 and add the folder as an assignment to the course.
  3. Open ~/A/A1/Lab1.ipynb. Select View / Create assignment (nbgrader).
  4. Add a code cell by selecting "Autograded answer" at right and leave the default contents.
  5. Add a second code cell by selecting "Autograder tests" and leave the default contents.
  6. Click Validate then Generate student version.
  7. In course "Assignments" tab, distribute the assignment to the student project, collect it, and run nbgrader to get a score of "0 / 1".
  8. Here is where the error is introduced. In a terminal, do this (the name of the destination file doesn't matter as long as its extension is .ipynb):
    cd ~/A/A1
    cp student/Lab1.ipynb x.ipynb
  9. Back in the course "Assignments" tab, run nbgrader again. Observe that nbgrader fails with this message: "Error: Error: ENOENT: no such file or directory, open 'nbg2020-001-collect/Assignments/Assignment5/650a039a-c296-412f-ab24-db21a605306d/x.ipynb' - try running nbgrader again." Screenshot below.
nbgrader-ENOENT
williamstein commented 1 week ago

This is intentional. Adding new ipynb files after the fact is going to break things, since the files to be graded depend on the notebooks that exist.