use of org.stepik.api.objects.instructions.Instruction in project intellij-plugins by StepicOrg.
the class FreeAnswerQuizHelper method isFrozen.
private boolean isFrozen() {
if (!needReview()) {
return true;
}
Step data = getStepNode().getData();
if (data == null) {
return true;
}
int instructionId = data.getInstruction();
if (instructionId == 0) {
return true;
}
StepikApiClient stepikClient = authAndGetStepikApiClient();
if (!isAuthenticated()) {
return true;
}
try {
Instructions instructions = stepikClient.instructions().get().id(instructionId).execute();
if (!instructions.isEmpty()) {
Instruction instruction = instructions.getFirst();
return instruction.isFrozen();
}
} catch (StepikClientException e) {
logger.warn(e);
}
return true;
}
Aggregations