<commit_before>appForm.stores = function(module) {
  var Store = appForm.stores.Store;
  module.mBaaS = new MBaaS();

  function MBaaS() {
    Store.call(this, 'MBaaS');
  }
  appForm.utils.extend(MBaaS, Store);
  MBaaS.prototype.checkStudio = function() {
    return appForm.config.get("studioMode");
  };
  MBaaS.prototype.create = function(model, cb) {
    if (this.checkStudio()) {
      cb("Studio mode not supported");
    } else {
      var url = _getUrl(model);
      appForm.web.ajax.post(url, model.getProps(), cb);
    }

  };
  MBaaS.prototype.read = function(model, cb) {
    if (this.checkStudio()) {
      cb("Studio mode not supported");
    } else {
      if (model.get("_type") == "offlineTest") {
        cb("offlinetest. ignore");
      } else {
        var url = _getUrl(model);
        appForm.web.ajax.get(url, cb);
      }
    }
  };
  MBaaS.prototype.update = function(model, cb) {};
  MBaaS.prototype["delete"] = function(model, cb) {};
  //@Deprecated use create instead
  MBaaS.prototype.completeSubmission = function(submissionToComplete, cb) {
    var url = _getUrl(submissionToComplete);
    appForm.web.ajax.post(url, {}, cb);
  };
  MBaaS.prototype.submissionStatus = function(submission, cb) {
    var url = _getUrl(submission);
    appForm.web.ajax.get(url, cb);
  };

  function _getUrl(model) {
    var type = model.get('_type');
    console.log("appForm.config: ", appForm.config);
    var host = appForm.config.get('cloudHost');
    var mBaaSBaseUrl = appForm.config.get('mbaasBaseUrl');
    var formUrls = appForm.config.get('formUrls');<commit_msg>Fixed bug with merge of file upload<commit_after>appForm.stores = function(module) {
  var Store = appForm.stores.Store;
  module.mBaaS = new MBaaS();

  function MBaaS() {
    Store.call(this, 'MBaaS');
  }
  appForm.utils.extend(MBaaS, Store);
  MBaaS.prototype.checkStudio = function() {
    return appForm.config.get("studioMode");
  };
  MBaaS.prototype.create = function(model, cb) {
    if (this.checkStudio()) {
      cb("Studio mode not supported");
    } else {
      var url = _getUrl(model);
      if((model.get("_type") == "fileSubmission" || model.get("_type") == "base64fileSubmission") && (typeof window.Phonegap !== "undefined" || typeof window.cordova !== "undefined")){
        appForm.web.uploadFile(url, model.getProps(), cb);
      } else {
        appForm.web.ajax.post(url, model.getProps(), cb);
      }
    }
  };
  MBaaS.prototype.read = function(model, cb) {
    if (this.checkStudio()) {
      cb("Studio mode not supported");
    } else {
      if (model.get("_type") == "offlineTest") {
        cb("offlinetest. ignore");
      } else {
        var url = _getUrl(model);
        appForm.web.ajax.get(url, cb);
      }
    }
  };
  MBaaS.prototype.update = function(model, cb) {};
  MBaaS.prototype["delete"] = function(model, cb) {};
  //@Deprecated use create instead
  MBaaS.prototype.completeSubmission = function(submissionToComplete, cb) {
    var url = _getUrl(submissionToComplete);
    appForm.web.ajax.post(url, {}, cb);
  };
  MBaaS.prototype.submissionStatus = function(submission, cb) {
    var url = _getUrl(submission);
    appForm.web.ajax.get(url, cb);
  };

  function _getUrl(model) {
    var type = model.get('_type');
    console.log("appForm.config: ", appForm.config);
    var host = appForm.config.get('cloudHost');
    var mBaaSBaseUrl = appForm.config.get('mbaasBaseUrl');
    var formUrls = appForm.config.get('formUrls');
{'fraction_non_alphanumeric': 0.16205305651672433, 'fraction_numerical': 0.0005767012687427913, 'mean_word_length': 3.298636926889715, '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': '6528537', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1182, 'n_words': 213}