Files
VisualSapfor/src/TestingSystem/Common/Test/Test.java

54 lines
1.7 KiB
Java
Raw Normal View History

package TestingSystem.Common.Test;
import Common.Constants;
2023-09-17 22:13:42 +03:00
import Common.Current;
import Common.Database.DBObject;
import Common.Database.riDBObject;
2023-11-17 00:04:21 +03:00
import Common.Global;
2023-09-17 22:13:42 +03:00
import Common.UI.UI;
import com.sun.org.glassfish.gmbal.Description;
2023-11-17 00:04:21 +03:00
import java.io.File;
public class Test extends riDBObject {
2023-09-17 22:13:42 +03:00
@Description("DEFAULT 1")
public int dim = 1; //размерность теста. для удобства пусть будет и внешним полем.
@Description("DEFAULT ''")
public String args = ""; //аргументы командной строки. на всякий случай поле зарезервирую. пусть будут.
@Description("DEFAULT -1")
public int group_id = Constants.Nan;
2023-09-17 22:13:42 +03:00
@Override
public void SynchronizeFields(DBObject src) {
super.SynchronizeFields(src);
Test t = (Test) src;
dim = t.dim;
args = t.args;
group_id = t.group_id;
}
public Test(Test test) {
this.SynchronizeFields(test);
}
public Test() {
}
@Override
public void select(boolean flag) {
super.select(flag);
if (Current.hasUI())
UI.getMainWindow().ShowCheckedTestsCount();
2023-09-17 22:13:42 +03:00
}
2023-11-17 00:04:21 +03:00
//---
@Override
public boolean isVisible() {
return Current.HasGroup() && (Current.getGroup().id == group_id);
}
//-
public File getArchive() {
return new File(Global.TestsDirectory, id + ".zip");
}
//-
public File getServerPath() {
return new File(Global.TestsDirectory, String.valueOf(id));
}
public File getHomePath() {
return new File(Global.visualiser.getWorkspace(), String.valueOf(id));
}
2023-09-17 22:13:42 +03:00
}