<commit_before>import { first } from 'lodash';
const {
  Factory, sequence, uuid, reference, fake,
} = require('./helpers');

Factory.define('TutorExercise')
  .id(sequence)
  .content(reference('Exercise'))
  .has_interactive(() => fake.random.arrayElement([true, false, false, false]))
  .has_video(() => fake.random.arrayElement([true, false, false]))
  .is_excluded(false)
  .page_uuid(uuid)
  .pool_types(() => [
    fake.random.arrayElement(['homework_core', 'reading_dynamic' ]),
  ])
  .tags(({ object }) =>
    object.content.tags.map(t => ({ id: t, type: first(t.split(':')), is_visible: true })),
  )
  .url(({ object }) =>
    `https://exercises.openstax.org/exercises/${object.content.uid}`
  )
  .question_stats(() => []);
<commit_msg>use require, make sure shared exercises are avail<commit_after>const { first } = require('lodash');
const {
  Factory, sequence, uuid, reference, fake,
} = require('./helpers');
require('../../../shared/specs/factories/exercise')

Factory.define('TutorExercise')
  .id(sequence)
  .content(reference('Exercise'))
  .has_interactive(() => fake.random.arrayElement([true, false, false, false]))
  .has_video(() => fake.random.arrayElement([true, false, false]))
  .is_excluded(false)
  .page_uuid(uuid)
  .pool_types(() => [
    fake.random.arrayElement(['homework_core', 'reading_dynamic' ]),
  ])
  .tags(({ object }) =>
    object.content.tags.map(t => ({ id: t, type: first(t.split(':')), is_visible: true })),
  )
  .url(({ object }) =>
    `https://exercises.openstax.org/exercises/${object.content.uid}`
  )
  .question_stats(() => []);

{'fraction_non_alphanumeric': 0.2174732872407291, 'fraction_numerical': 0.0, 'mean_word_length': 4.470790378006873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '6626081', 'n_tokens_mistral': 551, 'n_tokens_neox': 550, 'n_words': 89}