<commit_before>Ext.define('adnat.controller.ResultsController', {
    extend: 'Ext.app.Controller',
    config: {
        routes: {
        },
        refs: {
            gscore: '#gScore',
            pscore: '#pScore'
        },
        control: {
        }
    },
    requires: [
        'adnat.model.AssessmentResponse',
        'Ext.util.DelayedTask'
    ],
    hideComponents: function() {
        Ext.getCmp('noScore').hide();
        Ext.getCmp('gScore').hide();
        Ext.getCmp('pScore').hide();
        Ext.getCmp('gScoreRed').hide();
        Ext.getCmp('gScoreYellow').hide();
        Ext.getCmp('gScoreGreen').hide();
        Ext.getCmp('pScoreRed').hide();
        Ext.getCmp('pScoreYellow').hide();
        Ext.getCmp('pScoreGreen').hide();
        Ext.getCmp('submittedDate').hide();
    },
    onShow: function() {
        this.hideComponents();
        if (isReadyToScore()) {
            this.displayScore();
        } else {
            Ext.getCmp('noScore').show();
        }
    },
    displayScore: function() {
        Ext.Viewport.mask({xtype: 'loadmask', indicator: false, message: 'Scoring...'});
        var pscore = this.getPscore();
        var gscore = this.getGscore();

        score(function() {<commit_msg>handle async responses load for checking submit status<commit_after>Ext.define('adnat.controller.ResultsController', {
    extend: 'Ext.app.Controller',
    config: {
        routes: {
        },
        refs: {
            gscore: '#gScore',
            pscore: '#pScore'
        },
        control: {
        }
    },
    requires: [
        'adnat.model.AssessmentResponse',
        'Ext.util.DelayedTask'
    ],
    hideComponents: function() {
        Ext.getCmp('noScore').hide();
        Ext.getCmp('gScore').hide();
        Ext.getCmp('pScore').hide();
        Ext.getCmp('gScoreRed').hide();
        Ext.getCmp('gScoreYellow').hide();
        Ext.getCmp('gScoreGreen').hide();
        Ext.getCmp('pScoreRed').hide();
        Ext.getCmp('pScoreYellow').hide();
        Ext.getCmp('pScoreGreen').hide();
        Ext.getCmp('submittedDate').hide();
    },
    onShow: function() {
        this.hideComponents();
        this.loadResponses();
    },
    loadResponses: function() {
        Ext.getStore('Responses').load({
            callback: this.onResponsesStoreLoad,
            scope: this
        });
    },
    onResponsesStoreLoad: function() {
        if (isReadyToScore()) {
            this.displayScore();
        } else {
            Ext.getCmp('noScore').show();
        }
    },
    displayScore: function() {
        Ext.Viewport.mask({xtype: 'loadmask', indicator: false, message: 'Scoring...'});
        var pscore = this.getPscore();
        var gscore = this.getGscore();

        score(function() {
{'fraction_non_alphanumeric': 0.16871387283236994, 'fraction_numerical': 0.0, 'mean_word_length': 2.0529217199558984, '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': '3812496', 'n_tokens_mistral': 831, 'n_tokens_neox': 850, 'n_words': 115}