|
@@ -167,8 +167,8 @@ public class OnlineJudgeLogicImpl implements OnlineJudgeLogic {
|
|
|
|
|
|
//写入文件
|
|
//写入文件
|
|
String code = onlineJudgeVO.getCode () == null? "":onlineJudgeVO.getCode ();
|
|
String code = onlineJudgeVO.getCode () == null? "":onlineJudgeVO.getCode ();
|
|
- boolean writeSuccess = FileUtils.writingStringToFile(code,storePath + "main.py") &&
|
|
|
|
- FileUtils.writingStringToFile(properties.toString(),storePath + ".mooctest"+ File.separator + "properties");
|
|
|
|
|
|
+ boolean writeSuccess = FileUtils.writingStringToFile(code,storePath + Constants.MAIN_NAME) &&
|
|
|
|
+ FileUtils.writingStringToFile(properties.toString(),storePath + Constants.MOOCTEST_PATH + File.separator + "properties");
|
|
// 压缩成webide可打开的模式
|
|
// 压缩成webide可打开的模式
|
|
if(writeSuccess) {
|
|
if(writeSuccess) {
|
|
String caseName = caseService.getCaseExtendsById(onlineJudgeVO.getCaseId()).getName();
|
|
String caseName = caseService.getCaseExtendsById(onlineJudgeVO.getCaseId()).getName();
|
|
@@ -250,7 +250,7 @@ public class OnlineJudgeLogicImpl implements OnlineJudgeLogic {
|
|
FileUtils.unZipMultiFile (path+File.separator+"result"+File.separator+"result"+latestTimestmp+".zip",
|
|
FileUtils.unZipMultiFile (path+File.separator+"result"+File.separator+"result"+latestTimestmp+".zip",
|
|
path+File.separator+"result"+File.separator);
|
|
path+File.separator+"result"+File.separator);
|
|
try {
|
|
try {
|
|
- code = FileUtils.readToString (path+File.separator+"result"+File.separator+"main.py");
|
|
|
|
|
|
+ code = FileUtils.readToString (path+File.separator+"result"+File.separator+Constants.MAIN_NAME);
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace ();
|
|
e.printStackTrace ();
|
|
}
|
|
}
|
|
@@ -265,7 +265,7 @@ public class OnlineJudgeLogicImpl implements OnlineJudgeLogic {
|
|
// 解压缩
|
|
// 解压缩
|
|
FileUtils.unZipMultiFile(path+name,path);
|
|
FileUtils.unZipMultiFile(path+name,path);
|
|
try {
|
|
try {
|
|
- code = FileUtils.readToString(path+"main.py");
|
|
|
|
|
|
+ code = FileUtils.readToString(path+Constants.MAIN_NAME);
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace ();
|
|
e.printStackTrace ();
|
|
}
|
|
}
|