示例#1
0
	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;
	}
示例#2
0
	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);
	}
示例#4
0
	@Override
	public void reset() {
		readyToDraggableItem = null;
		consumedItem = null;
		view.setImageUrl("");
		view.setDisabled(model.isDisabled());

		if (model.isVisible()) {
			view.show();
		} else {
			view.hide();
		}
	}
示例#5
0
	@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());
		}
	}
示例#6
0
	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");
	}
示例#7
0
	@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");
	}
示例#8
0
	@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);
	}
示例#10
0
	@Override
	public void setShowErrorsMode() {
		view.setShowErrorsMode(true);
		view.setDisabled(true);
	}
示例#11
0
	public void enable(){
		view.setDisabled(false);
	}
示例#12
0
	public void disable() {
		view.setDisabled(true);
	}
示例#13
0
	@Override
	public void setWorkMode() {
		view.resetStyles();
		view.setDisabled(workModeDisabled);
		isShowErrorsMode = false;
	}