@@ -24,8 +24,8 @@ use std::{
24
24
path:: { Path , PathBuf } ,
25
25
} ;
26
26
use tmc_langs:: {
27
- CommandError , Compression , Credentials , DownloadOrUpdateCourseExercisesResult , DownloadResult ,
28
- Language , StyleValidationResult , TmcConfig , UpdatedExercise ,
27
+ CommandError , Compression , Credentials , DownloadOrUpdateTmcCourseExercisesResult ,
28
+ DownloadResult , Language , StyleValidationResult , TmcConfig , UpdatedExercise ,
29
29
file_util:: { self , Lock , LockOptions } ,
30
30
mooc:: { MoocClient , MoocClientError } ,
31
31
tmc:: { TestMyCodeClient , TestMyCodeClientError , request:: FeedbackAnswer } ,
@@ -231,7 +231,7 @@ fn run_app(cli: Cli) -> Result<CliOutput> {
231
231
let mut lock = Lock :: dir ( & exercise_path, LockOptions :: Read ) ?;
232
232
let _guard = lock. lock ( ) ?;
233
233
234
- let hash = tmc_langs:: compress_project_to (
234
+ let hash = tmc_langs:: compress_project_to_with_hash (
235
235
& exercise_path,
236
236
& output_path,
237
237
compression,
@@ -674,7 +674,7 @@ fn run_tmc_inner(
674
674
DownloadResult :: Success {
675
675
downloaded,
676
676
skipped,
677
- } => DownloadOrUpdateCourseExercisesResult {
677
+ } => DownloadOrUpdateTmcCourseExercisesResult {
678
678
downloaded,
679
679
skipped,
680
680
failed : None ,
@@ -683,15 +683,15 @@ fn run_tmc_inner(
683
683
downloaded,
684
684
skipped,
685
685
failed,
686
- } => DownloadOrUpdateCourseExercisesResult {
686
+ } => DownloadOrUpdateTmcCourseExercisesResult {
687
687
downloaded,
688
688
skipped,
689
689
failed : Some ( failed) ,
690
690
} ,
691
691
} ;
692
692
CliOutput :: finished_with_data (
693
693
"downloaded or updated exercises" ,
694
- DataKind :: ExerciseDownload ( data) ,
694
+ DataKind :: TmcExerciseDownload ( data) ,
695
695
)
696
696
}
697
697
@@ -1011,10 +1011,10 @@ fn run_tmc_inner(
1011
1011
1012
1012
TestMyCodeCommand :: UpdateExercises => {
1013
1013
let projects_dir = tmc_langs:: get_projects_dir ( client_name) ?;
1014
- let data = tmc_langs:: update_exercises ( client, & projects_dir) ?;
1014
+ let data = tmc_langs:: update_tmc_exercises ( client, & projects_dir) ?;
1015
1015
CliOutput :: finished_with_data (
1016
1016
"downloaded or updated exercises" ,
1017
- DataKind :: ExerciseDownload ( data) ,
1017
+ DataKind :: TmcExerciseDownload ( data) ,
1018
1018
)
1019
1019
}
1020
1020
@@ -1064,6 +1064,8 @@ fn run_mooc(mooc: Mooc) -> Result<CliOutput> {
1064
1064
}
1065
1065
1066
1066
fn run_mooc_inner ( mooc : Mooc , client : & mut MoocClient ) -> Result < CliOutput > {
1067
+ let client_name = & mooc. client_name ;
1068
+
1067
1069
let output = match mooc. command {
1068
1070
MoocCommand :: CourseInstance {
1069
1071
course_instance_id : _,
@@ -1102,6 +1104,11 @@ fn run_mooc_inner(mooc: Mooc, client: &mut MoocClient) -> Result<CliOutput> {
1102
1104
) ?;
1103
1105
CliOutput :: finished ( "downloaded exercise" )
1104
1106
}
1107
+ MoocCommand :: UpdateExercises => {
1108
+ let projects_dir = tmc_langs:: get_projects_dir ( client_name) ?;
1109
+ let res = tmc_langs:: update_mooc_exercises ( client, & projects_dir) ?;
1110
+ CliOutput :: finished_with_data ( "updated exercises" , DataKind :: MoocExerciseDownload ( res) )
1111
+ }
1105
1112
MoocCommand :: Submit {
1106
1113
exercise_id,
1107
1114
slide_id,
0 commit comments