use of com.cas.sim.tis.view.controller.ExamController 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.view.controller.ExamController 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);
}
Aggregations