File tree Expand file tree Collapse file tree 4 files changed +9
-7
lines changed
Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,15 @@ impl StudentFilePolicy for Python3StudentFilePolicy {
3434 None => true ,
3535 } ;
3636 let is_py_file = path. extension ( ) == Some ( OsStr :: new ( "py" ) ) ;
37+ let is_ipynb = path. extension ( ) == Some ( OsStr :: new ( "ipynb" ) ) ;
3738
3839 // all files in non-tmc and non-test subdirectories are considered student files
3940 let is_in_exercise_subdir = path. starts_with ( "test" ) || path. starts_with ( "tmc" ) ;
4041
4142 in_src && !is_cache_file
4243 || is_in_project_root && is_py_file
4344 || !is_in_exercise_subdir && !is_in_project_root && !is_cache_file
45+ || is_ipynb && !is_cache_file
4446 }
4547}
4648
Original file line number Diff line number Diff line change @@ -37,14 +37,14 @@ pub fn zip_student_files<P: StudentFilePolicy>(
3737 log:: trace!( "adding directory {}" , path. display( ) ) ;
3838 writer. add_directory (
3939 path_to_zip_compatible_string ( path) ,
40- FileOptions :: default ( ) . unix_permissions ( 0o744 ) ,
40+ FileOptions :: default ( ) . unix_permissions ( 0o755 ) ,
4141 ) ?;
4242 } else {
4343 let bytes = file_util:: read_file ( entry. path ( ) ) ?;
4444 log:: trace!( "writing file {}" , path. display( ) ) ;
4545 writer. start_file (
4646 path_to_zip_compatible_string ( path) ,
47- FileOptions :: default ( ) . unix_permissions ( 0o744 ) ,
47+ FileOptions :: default ( ) . unix_permissions ( 0o755 ) ,
4848 ) ?;
4949 writer
5050 . write_all ( & bytes)
Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ fn execute_zip(
394394 let tmcproject_yml = file_util:: read_file ( & tmcproject_yml_path) ?;
395395 let relative_path = tmcproject_yml_path
396396 . strip_prefix ( & root_path)
397- . expect ( "relative path failed for tmcproject yml " ) ; // safe
397+ . expect ( "tmcproject_yml_path is inside root_path " ) ;
398398 writer. start_file (
399399 relative_path. to_string_lossy ( ) ,
400400 zip:: write:: FileOptions :: default ( ) ,
@@ -420,15 +420,15 @@ fn execute_zip(
420420 if entry. path ( ) . is_file ( ) {
421421 writer. start_file (
422422 relative_path. to_string_lossy ( ) ,
423- zip:: write:: FileOptions :: default ( ) . unix_permissions ( 0o744 ) ,
423+ zip:: write:: FileOptions :: default ( ) . unix_permissions ( 0o755 ) ,
424424 ) ?;
425425 let bytes = file_util:: read_file ( entry. path ( ) ) ?;
426426 writer. write_all ( & bytes) . map_err ( LangsError :: ZipWrite ) ?;
427427 } else {
428428 // java-langs expects directories to have their own entries
429429 writer. start_file (
430430 relative_path. join ( "" ) . to_string_lossy ( ) , // java-langs expects directory entries to have a trailing slash
431- zip:: write:: FileOptions :: default ( ) . unix_permissions ( 0o744 ) ,
431+ zip:: write:: FileOptions :: default ( ) . unix_permissions ( 0o755 ) ,
432432 ) ?;
433433 }
434434 }
Original file line number Diff line number Diff line change @@ -296,12 +296,12 @@ pub fn prepare_submission(
296296 if entry_path. is_dir ( ) {
297297 archive. add_directory (
298298 stripped. to_string_lossy ( ) ,
299- FileOptions :: default ( ) . unix_permissions ( 0o744 ) ,
299+ FileOptions :: default ( ) . unix_permissions ( 0o755 ) ,
300300 ) ?;
301301 } else {
302302 archive. start_file (
303303 stripped. to_string_lossy ( ) ,
304- FileOptions :: default ( ) . unix_permissions ( 0o744 ) ,
304+ FileOptions :: default ( ) . unix_permissions ( 0o755 ) ,
305305 ) ?;
306306 let mut file = file_util:: open_file ( entry_path) ?;
307307 std:: io:: copy ( & mut file, & mut archive)
You can’t perform that action at this time.
0 commit comments