use of org.stepik.core.courseFormat.stepHelpers.VideoTheoryHelper in project intellij-plugins by StepicOrg.
the class StudyToolWindow method setText.
private void setText(@Nullable StepNode stepNode) {
if (stepNode == null) {
setEmptyText();
rightPanel.setVisible(false);
return;
}
browserWindow.showLoadAnimation();
StepType stepType = stepNode.getType();
if (stepType != VIDEO && stepType != CODE) {
SwingUtilities.invokeLater(() -> rightPanel.setVisible(false));
}
boolean isTheory = stepType == VIDEO || stepType == TEXT;
postView(stepNode, isTheory);
StepHelper stepHelper = null;
switch(stepType) {
case UNKNOWN:
stepHelper = new StepHelper(project, stepNode);
break;
case CODE:
stepHelper = new CodeQuizHelper(project, stepNode);
updateLanguageBox(stepNode);
break;
case TEXT:
stepHelper = new TextTheoryHelper(project, stepNode);
break;
case VIDEO:
stepHelper = new VideoTheoryHelper(project, stepNode);
break;
case CHOICE:
stepHelper = new ChoiceQuizHelper(project, stepNode);
break;
case STRING:
stepHelper = new StringQuizHelper(project, stepNode);
break;
case SORTING:
stepHelper = new SortingQuizHelper(project, stepNode);
break;
case MATCHING:
stepHelper = new MatchingQuizHelper(project, stepNode);
break;
case NUMBER:
stepHelper = new NumberQuizHelper(project, stepNode);
break;
case DATASET:
stepHelper = new DatasetQuizHelper(project, stepNode);
break;
case TABLE:
stepHelper = new TableQuizHelper(project, stepNode);
break;
case FILL_BLANKS:
stepHelper = new QuizHelper(project, stepNode);
break;
case MATH:
stepHelper = new QuizHelper(project, stepNode);
break;
case FREE_ANSWER:
stepHelper = new FreeAnswerQuizHelper(project, stepNode);
break;
}
HashMap<String, Object> params = new HashMap<>();
params.put("stepNode", stepHelper);
params.put("darcula", LafManager.getInstance().getCurrentLookAndFeel() instanceof DarculaLookAndFeelInfo);
browserWindow.loadContent("quiz/" + stepHelper.getType(), params);
}
Aggregations