<commit_before>function doGet(e) {
  var params = JSON.stringify(e);
  return HtmlService.createHtmlOutput(params);
};

function doPost(e) { 
  var params = JSON.stringify(e);
  return HtmlService.createHtmlOutput(params);
};
<commit_msg>Pull random row from questions.<commit_after>QID = 'SECRET';

function doGet(e) {
  if (!e || !e.parameter) {
    return HtmlService.createHtmlOutput('Invalid parameters.');
  } else {
    // var subject = e.parameter.subject;
    var sheet = SpreadsheetApp.openById(QID).getSheets()[0];
    var max = sheet.getLastRow();
    var rowId = Math.floor(Math.random() * max) + 1;    
    var row = sheet.getRange('A' + rowId + ':G' + rowId).getValues()[0];
    
    var data = {
      'id': row[0],
      'q': row[1],
      'a': row[2],
      'b': row[3],
      'c': row[4],
      'd': row[5],
      'ans': row[6]
    };
    
    return HtmlService.createHtmlOutput(JSON.stringify(data));
  }
};

function doPost(e) {
  var params = JSON.stringify(e);
  return HtmlService.createHtmlOutput(params);
};

{'fraction_non_alphanumeric': 0.17101449275362318, 'fraction_numerical': 0.00966183574879227, 'mean_word_length': 3.263374485596708, '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': '2899817', 'n_tokens_mistral': 370, 'n_tokens_neox': 364, 'n_words': 74}