rage / tmc-langs-rust

A library and CLI for supporting different programming languages in the TestMyCode programming assignment evaluator.
https://tmc.mooc.fi/
Apache License 2.0
8 stars 9 forks source link

update_exercises is flawed / tmc-langs/lib.rs #168

Closed zjuxicu closed 3 years ago

zjuxicu commented 3 years ago

Current code gives File I/O error: https://github.com/rage/tmc-langs-rust/blob/b4bb6f8ea23f13d0771da069bf58d60b98ddf6dd/tmc-langs/src/lib.rs#L575

We copied this block from download function and it worked well:

let zip_file = file_util::named_temp_file()?;
client.download_exercise(exercise.id, zip_file.path())?;
extract_project(zip_file, &exercise.path, false)?;

Course_data is initialized, but never filled https://github.com/rage/tmc-langs-rust/blob/b4bb6f8ea23f13d0771da069bf58d60b98ddf6dd/tmc-langs/src/lib.rs#L528 Is empty when later used in and doesn't update the course config file. https://github.com/rage/tmc-langs-rust/blob/b4bb6f8ea23f13d0771da069bf58d60b98ddf6dd/tmc-langs/src/lib.rs#L578-L582