<commit_before>import * as Qti1Selectors  from "../parsers/qti1/selectors";
import * as Qti2Assessment from "../parsers/qti2/selectors";
import * as EdxAssessment  from "../parsers/edX/selectors";

function getParser(metaData){
  return {
    "QTI1": Qti1Selectors,
    "QTI2": Qti2Assessment,
    "EDX": EdxAssessment
  }[metaData.get('type')];
}

function makeSelector(name){
  return (state, props) => {
    var parser = getParser(state.assessment);
    if(!parser){return parser;} // Handle no assessment loaded 
    var func = parser[name];
    return func(state, props);
  };
}

// Selectors that will interact with the assessment data.
// All of these take state and props as parameters and just
// wrap a call to the selectors native to the assessment.
export const questions = makeSelector("questions");
export const outcomes = makeSelector("outcomes");
export const questionCount = makeSelector("questionCount");<commit_msg>use standard instead of type<commit_after>import * as Qti1Selectors  from "../parsers/qti1/selectors";
import * as Qti2Assessment from "../parsers/qti2/selectors";
import * as EdxAssessment  from "../parsers/edX/selectors";

function getParser(metaData){
  return {
    "QTI1": Qti1Selectors,
    "QTI2": Qti2Assessment,
    "EDX": EdxAssessment
  }[metaData.get('standard')];
}

function makeSelector(name){
  return (state, props) => {
    var parser = getParser(state.assessment);
    if(!parser){return parser;} // Handle no assessment loaded
    var func = parser[name];
    return func(state, props);
  };
}

// Selectors that will interact with the assessment data.
// All of these take state and props as parameters and just
// wrap a call to the selectors native to the assessment.
export const questions = makeSelector("questions");
export const outcomes = makeSelector("outcomes");
export const questionCount = makeSelector("questionCount");
{'fraction_non_alphanumeric': 0.12089077412513255, 'fraction_numerical': 0.008483563096500531, 'mean_word_length': 4.422413793103448, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 5, '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': '7567965', 'n_tokens_mistral': 556, 'n_tokens_neox': 550, 'n_words': 175}