use of com.cas.sim.tis.entity.LibraryPublish in project TeachingInSimulation by ScOrPiOzzy.
the class ExamMessageHandler method execute.
@Override
public void execute(Client client, ExamMessage m) throws Exception {
int type = m.getType();
if (ExamMessage.EXAM_START == type) {
LibraryPublish publish = SpringUtil.getBean(LibraryPublishAction.class).findPublishById(m.getPid());
Platform.runLater(() -> {
Application.showView(ExamView.class);
ExamController controller = SpringUtil.getBean(ExamController.class);
controller.initialize(publish);
});
} else if (ExamMessage.EXAM_OVER == type) {
Platform.runLater(() -> {
ExamController controller = SpringUtil.getBean(ExamController.class);
if (m.getPid() == controller.getLibraryPublish().getId()) {
controller.submit(true);
}
});
}
}
use of com.cas.sim.tis.entity.LibraryPublish in project TeachingInSimulation by ScOrPiOzzy.
the class PreviewQuestionPaper method practice.
@FXML
private void practice() {
int id = SpringUtil.getBean(LibraryPublishAction.class).practiceLibraryByStudent(rid);
LibraryPublish publish = SpringUtil.getBean(LibraryPublishAction.class).findPublishById(id);
Application.showView(ExamView.class);
ExamController controller = SpringUtil.getBean(ExamController.class);
controller.initialize(publish);
}
use of com.cas.sim.tis.entity.LibraryPublish in project TeachingInSimulation by ScOrPiOzzy.
the class LibraryPublishAction method practiceLibraryByStudent.
public int practiceLibraryByStudent(int rid) {
LibraryPublish publish = new LibraryPublish();
publish.setLibraryId(rid);
publish.setCreator(Session.get(Session.KEY_LOGIN_ID));
publish.setType(LibraryPublishType.PRACTICE.getType());
return getService().practiceLibraryByStudent(publish);
}
Aggregations