@@ -68,6 +68,29 @@ public static boolean runAndStop(File workingDir, boolean enableInsecureDebugMec
68
68
if (stage == Stage .JPLAG || stage == Stage .SUMMARY )
69
69
return false ;
70
70
71
+ if (stage == Stage .DOWNLOAD && submissions .size () == 0 ) {
72
+ System .out .println ();
73
+ System .out .println ();
74
+ System .out .println ("WARNING: No submissions present after DOWNLOAD stage" );
75
+ System .out .println ();
76
+ System .out .println ("This is usually an indicator that something went wrong." );
77
+ System .out .println ();
78
+ if (usesBypassDownloadStage (config )) {
79
+ System .out .println ("Check your submissions ZIP file. Are there really no submissions or\n " +
80
+ "is it invalid? Don't bother continuing in case there are no\n " +
81
+ "submissions. The JPLAG stage won't work without submissions." );
82
+ } else {
83
+ System .out .println ("You might have specified an incorrect moodleBaseURL. The moodleBaseURL\n " +
84
+ "config property should be the URL of your Moodle's login page minus\n " +
85
+ "the \" /login/index.php\" at the end." );
86
+ System .out .println ();
87
+ System .out .println ("If your Moodle does not have a URL like that it's probably\n incompatible with Automark." );
88
+ }
89
+ System .out .println ();
90
+ System .out .println ();
91
+ return false ;
92
+ }
93
+
71
94
if (stopAfterOneStage )
72
95
return true ;
73
96
}
@@ -84,7 +107,7 @@ private static List<Submission> runStage(
84
107
) throws UserFriendlyException {
85
108
switch (stage ) {
86
109
case DOWNLOAD :
87
- if ("bypass" . equals (config . get ( Config . DOWNLOAD_STAGE ) ))
110
+ if (usesBypassDownloadStage (config ))
88
111
return BypassDownloadStage .run (workingDir , config );
89
112
else
90
113
return MoodleScraperStage .run (workingDir , config );
@@ -108,4 +131,8 @@ private static List<Submission> runStage(
108
131
throw new UserFriendlyException ("Invalid state: Tried to execute a stage that isn't implemented: " + stage .name ());
109
132
}
110
133
}
134
+
135
+ private static boolean usesBypassDownloadStage (Properties config ) {
136
+ return "bypass" .equals (config .get (Config .DOWNLOAD_STAGE ));
137
+ }
111
138
}
0 commit comments