<commit_before>import { Component } from '@angular/core';

import { Question } from "../shared/models/question.model";

var jquery = require('jquery');

@Component({
  selector: 'bro-question-view',
  template: require('./question-view.component.html'),
  styles: [ require('./question-view.component.css') ]
})
export class QuestionViewComponent {
  questions: Array<Question>;
  assignment: string;
  currentQuestion: Question;
  currentQuestionIndex: number = 0;

  ngOnInit() {
    this.assignment = 'Social Studies DA';
    this.questions = [
      new Question(1, 4, 'A'),
      new Question(2, 4, 'A'),
      new Question(3, 4, 'A'),
      new Question(4, 4, 'A'),
      new Question(5, 4, 'A'),
      new Question(6, 4, 'A')
    ];
    this.setCurrentQuestion();
  }

  prevQuestion(): void {
    if (!this.atFirstQuestion()) {
      this.currentQuestionIndex--;
      this.setCurrentQuestion();
      this.prevQuestionAnimation();
    }
  }

  atFirstQuestion(): boolean {
    return this.currentQuestionIndex === 0;
  }

  nextQuestion(): void {
    if (!this.atLastQuestion()) {
      this.currentQuestionIndex++;
      this.setCurrentQuestion();
      this.nextQuestionAnimation();
    }
  }

  atLastQuestion(): boolean {
    return this.currentQuestionIndex === this.questions.length-1;
  }

  setCurrentQuestion(): void {
    this.currentQuestion = this.questions[this.currentQuestionIndex];
  }

  answerQuestion(answerChoice: string): void {
    this.currentQuestion.answer(answerChoice);
    this.nextQuestion();
  }

  nextQuestionAnimation(): void {
    let answerButtons = jquery('.answer-buttons');
    answerButtons.addClass('next-question-slide');

    // Greatest hack ever to remove class after animation is done
    // set timeout to 500 because animation-duration is 0.5s
    // Will refactor when ng-animate is released
    setTimeout(() => {
      answerButtons.removeClass('next-question-slide');
    }, 500);
  }

  prevQuestionAnimation(): void {
    let answerButtons = jquery('.answer-buttons');
    answerButtons.addClass('prev-question-slide');

    // Greatest hack ever to remove class after animation is done
    // set timeout to 500 because animation-duration is 0.5s
    // Will refactor when ng-animate is released
    setTimeout(() => {
      answerButtons.removeClass('prev-question-slide');
    }, 500);
  }
}
<commit_msg>Add method accessors for methods that should be private<commit_after>import { Component } from '@angular/core';

import { Question } from "../shared/models/question.model";

var jquery = require('jquery');

@Component({
  selector: 'bro-question-view',
  template: require('./question-view.component.html'),
  styles: [ require('./question-view.component.css') ]
})
export class QuestionViewComponent {
  questions: Array<Question>;
  assignment: string;
  currentQuestion: Question;
  currentQuestionIndex: number = 0;

  ngOnInit() {
    this.assignment = 'Social Studies DA';
    this.questions = [
      new Question(1, 4, 'A'),
      new Question(2, 4, 'A'),
      new Question(3, 4, 'A'),
      new Question(4, 4, 'A'),
      new Question(5, 4, 'A'),
      new Question(6, 4, 'A')
    ];
    this.setCurrentQuestion();
  }

  prevQuestion(): void {
    if (!this.atFirstQuestion()) {
      this.currentQuestionIndex--;
      this.setCurrentQuestion();
      this.prevQuestionAnimation();
    }
  }

  private atFirstQuestion(): boolean {
    return this.currentQuestionIndex === 0;
  }

  nextQuestion(): void {
    if (!this.atLastQuestion()) {
      this.currentQuestionIndex++;
      this.setCurrentQuestion();
      this.nextQuestionAnimation();
    }
  }

  atLastQuestion(): boolean {
    return this.currentQuestionIndex === this.questions.length-1;
  }

  private setCurrentQuestion(): void {
    this.currentQuestion = this.questions[this.currentQuestionIndex];
  }

  answerQuestion(answerChoice: string): void {
    this.currentQuestion.answer(answerChoice);
    this.nextQuestion();
  }

  private nextQuestionAnimation(): void {
    let answerButtons = jquery('.answer-buttons');
    answerButtons.addClass('next-question-slide');

    // Greatest hack ever to remove class after animation is done
    // set timeout to 500 because animation-duration is 0.5s
    // Will refactor when ng-animate is released
    setTimeout(() => {
      answerButtons.removeClass('next-question-slide');
    }, 500);
  }

  private prevQuestionAnimation(): void {
    let answerButtons = jquery('.answer-buttons');
    answerButtons.addClass('prev-question-slide');

    // Greatest hack ever to remove class after animation is done
    // set timeout to 500 because animation-duration is 0.5s
    // Will refactor when ng-animate is released
    setTimeout(() => {
      answerButtons.removeClass('prev-question-slide');
    }, 500);
  }
}

{'fraction_non_alphanumeric': 0.1367414796342477, 'fraction_numerical': 0.012884455527847049, 'mean_word_length': 3.3477868112014453, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1555293', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1347, 'n_words': 332}