<commit_before>package eu.ydp.empiria.player.client.module.external.interaction;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.json.client.JSONArray;
import com.google.inject.Inject;
import eu.ydp.empiria.player.client.module.external.common.state.ExternalStateEncoder;
import eu.ydp.empiria.player.client.module.external.common.state.ExternalStateSaver;
import eu.ydp.empiria.player.client.module.external.interaction.api.ExternalApiProvider;
import eu.ydp.gwtutil.client.gin.scopes.module.ModuleScoped;

public class ExternalInteractionStateProvider {

    private final ExternalApiProvider externalApi;
    private final ExternalStateSaver stateSaver;
    private final ExternalStateEncoder stateEncoder;

    @Inject
    public ExternalInteractionStateProvider(@ModuleScoped ExternalApiProvider externalApi, ExternalStateSaver stateSaver, ExternalStateEncoder stateEncoder) {
        this.externalApi = externalApi;
        this.stateSaver = stateSaver;
        this.stateEncoder = stateEncoder;
    }

    public JSONArray getState() {
        JavaScriptObject state = externalApi.getExternalApi().getStateFromExternal();
        stateSaver.setExternalState(state);
        return stateEncoder.encodeState(state);
    }
}
<commit_msg>[YPUB-7885] added missing moduleScoped annotation<commit_after>package eu.ydp.empiria.player.client.module.external.interaction;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.json.client.JSONArray;
import com.google.inject.Inject;
import eu.ydp.empiria.player.client.module.external.common.state.ExternalStateEncoder;
import eu.ydp.empiria.player.client.module.external.common.state.ExternalStateSaver;
import eu.ydp.empiria.player.client.module.external.interaction.api.ExternalApiProvider;
import eu.ydp.gwtutil.client.gin.scopes.module.ModuleScoped;

public class ExternalInteractionStateProvider {

    private final ExternalApiProvider externalApi;
    private final ExternalStateSaver stateSaver;
    private final ExternalStateEncoder stateEncoder;

    @Inject
    public ExternalInteractionStateProvider(@ModuleScoped ExternalApiProvider externalApi, @ModuleScoped ExternalStateSaver stateSaver, ExternalStateEncoder stateEncoder) {
        this.externalApi = externalApi;
        this.stateSaver = stateSaver;
        this.stateEncoder = stateEncoder;
    }

    public JSONArray getState() {
        JavaScriptObject state = externalApi.getExternalApi().getStateFromExternal();
        stateSaver.setExternalState(state);
        return stateEncoder.encodeState(state);
    }
}

{'fraction_non_alphanumeric': 0.0843000773395205, 'fraction_numerical': 0.0015467904098994587, 'mean_word_length': 5.03030303030303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6653485', 'n_tokens_mistral': 742, 'n_tokens_neox': 718, 'n_words': 115}