private void hideAnswers() { if(!model.isActivity() && isConnectedWithMath){ this.isShowAnswersActive = false; view.setDisabled(false); } if ((!model.isActivity() || !this.isShowAnswersActive)) { return; } this.isShowAnswersActive = false; reset(); view.resetStyles(); view.setDisabled(false); setState(currentState); readyToDraggableItem = userReadyToDraggableItem; userReadyToDraggableItem = null; }
private void setGapAnswer(int index, String value) { isSetGapAnswers = true; ImageSourcePresenter igp = (ImageSourcePresenter) playerServices.getModule(value.replaceAll("\"", "")); view.setImageUrl(igp.getImageUrl()); view.resetStyles(); view.setDisabled(true); view.showCorrectAnswers(); view.removeClass("ui-state-disabled"); }
@Override public void reset() { if (model.isVisible()) { view.show(); } else { view.hide(); } view.setShowErrorsMode(false); view.setDisabled(false); }
@Override public void reset() { readyToDraggableItem = null; consumedItem = null; view.setImageUrl(""); view.setDisabled(model.isDisabled()); if (model.isVisible()) { view.show(); } else { view.hide(); } }
@Override public void addView(IModuleView display) { if (display instanceof IDisplay) { view = (IDisplay) display; view.addListener(new IViewListener() { @Override public void onClicked() { viewClicked(); } }); view.makeDroppable(this); view.setDisabled(model.isDisabled()); } }
private void showAnswers() { if(!model.isActivity() && isConnectedWithMath){ this.isShowAnswersActive = true; if(!isSetGapAnswers){ view.resetStyles(); } view.setDisabled(true); view.removeClass("ui-state-disabled"); } if (!model.isActivity() || this.isShowAnswersActive) { return; } this.isShowAnswersActive = true; userReadyToDraggableItem = readyToDraggableItem; showAnswersModeDisabled = view.getDisabled(); this.currentState = getState(); view.resetStyles(); view.setDisabled(true); setCorrectImage(); view.showCorrectAnswers(); view.removeClass("ui-state-disabled"); }
@Override public void setShowErrorsMode() { if (this.isShowAnswersActive) hideAnswers(); isShowErrorsMode = true; workModeDisabled = view.getDisabled(); view.setDisabled(true); if (model.isActivity()) { if (getScore() > 0) { view.showAsCorrect(); } else { view.showAsError(); } } view.removeClass("ui-state-disabled"); }
@Override public void setState(String stateObj) { IJsonServices json = playerServices.getJsonServices(); HashMap<String, String> state = json.decodeHashMap(stateObj); if (state.containsKey("consumed")) { consumedItem = DraggableItem.createFromString(state.get("consumed")); view.setImageUrl(getImageURL(consumedItem)); view.makeDraggable(this); } if (state.containsKey("isVisible")) { if (Boolean.parseBoolean(state.get("isVisible"))) { show(); } else { hide(); } } if (state.containsKey("isDisabled")) { view.setDisabled(Boolean.parseBoolean(state.get("isDisabled"))); } }
@Override public void setWorkMode() { view.setShowErrorsMode(false); view.setDisabled(false); }
@Override public void setShowErrorsMode() { view.setShowErrorsMode(true); view.setDisabled(true); }
public void enable(){ view.setDisabled(false); }
public void disable() { view.setDisabled(true); }
@Override public void setWorkMode() { view.resetStyles(); view.setDisabled(workModeDisabled); isShowErrorsMode = false; }