<commit_before><h1><%= @question.body %></h1>

<% if @question.user_id == session[:user_id] %>
	<%= link_to("edit", edit_question_path) %>
	<%= link_to "delete", @question, method: :delete, data: { confirm: "Delete this question?" } %>
<% end %>

<%= link_to "Up", question_upvote_path, method: :post, class: "up_button" %>
<%= @question.vote.score %>
<%= link_to "Down", question_downvote_path, method: :post, class: "down_button" %>
<br>
<br>

	<div id="add_comment_box_to_questions"></div>
<% unless @question.comments.empty? %>
	<h3> Comments on Question </h3>
	<ul>
		<% @question.comments.each do |comment| %>
			<li> <%= "#{User.find(comment.user_id).username} said... " + comment.body %> </li>
		<% end %>
	</ul>
<% end %>

<%= link_to "add comment", new_question_comment_path(@question), :remote => true %>


<% if @answers.empty? == false %>
	<h3>Answers</h3>
	<ol>
		<% @answers.each do |answer| %>
				<li> 
					<% answer_id = answer.id %>
					<%= answer.body %> 
					<div id="add_comment_box_to_answers_<%=answer_id%>"></div>

					<%= link_to("delete", [@question, answer], method: :delete, confirm: 'Sure you want to deprive us of your wisdom?') %> <br>
					<ul>
						<% if answer.comments.empty? == false %>
							<% answer.comments.each do |comment| %>
								<li> <%= "#{User.find(comment.user_id).username} said... " + comment.body %> </li>
							<% end %>
						<% end %> 
					</ul>
				</li>
	<%= link_to "add comment", new_answer_comment_path(answer_id), :remote => true %> <br>
		<% end %>
	</ol>

	<% else %>
	<h3> No one has provided an answer yet </h3>
<% end %>



<% if session[:user_id] != nil %>
	<%= form_for [@question, @answer] do |f| %>
		<%= f.label :answer %>
		<%= f.text_field :body %>
		<%= f.submit "submit answer"%>
	<% end %>
<% else %>
	<p> Login to post an answer! </p>
<% end %>
<commit_msg>can only delete an answer if its your answer<commit_after><h1><%= @question.body %></h1>

<% if @question.user_id == session[:user_id] %>
	<%= link_to("edit", edit_question_path) %>
	<%= link_to "delete", @question, method: :delete, data: { confirm: "Delete this question?" } %>
<% end %>

<%= link_to "Up", question_upvote_path, method: :post, class: "up_button" %>
<%= @question.vote.score %>
<%= link_to "Down", question_downvote_path, method: :post, class: "down_button" %>
<br>
<br>

	<div id="add_comment_box_to_questions"></div>
<% unless @question.comments.empty? %>
	<h3> Comments on Question </h3>
	<ul>
		<% @question.comments.each do |comment| %>
			<li> <%= "#{User.find(comment.user_id).username} said... " + comment.body %> </li>
		<% end %>
	</ul>
<% end %>

<%= link_to "add comment", new_question_comment_path(@question), :remote => true %>


<% if @answers.empty? == false %>
	<h3>Answers</h3>
	<ol>
		<% @answers.each do |answer| %>
				<li> 
					<% answer_id = answer.id %>
					<%= answer.body %> 
					<div id="add_comment_box_to_answers_<%=answer_id%>"></div>

					<% if session[:user_id] == answer.user.id %>
						<%= link_to("delete", [@question, answer], method: :delete, confirm: 'Sure you want to deprive us of your wisdom?') %> <br>
					<% end %>
					<ul>
						<% if answer.comments.empty? == false %>
							<% answer.comments.each do |comment| %>
								<li> <%= "#{User.find(comment.user_id).username} said... " + comment.body %> </li>
							<% end %>
						<% end %> 
					</ul>
				</li>
	<%= link_to "add comment", new_answer_comment_path(answer_id), :remote => true %> <br>
		<% end %>
	</ol>

	<% else %>
	<h3> No one has provided an answer yet </h3>
<% end %>



<% if session[:user_id] != nil %>
	<%= form_for [@question, @answer] do |f| %>
		<%= f.label :answer %>
		<%= f.text_field :body %>
		<%= f.submit "submit answer"%>
	<% end %>
<% else %>
	<p> Login to post an answer! </p>
<% end %>

{'fraction_non_alphanumeric': 0.2231317665698442, 'fraction_numerical': 0.004224980195405334, 'mean_word_length': 3.558363417569194, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 0, '>': 143, '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': '3008394', 'n_tokens_mistral': 1706, 'n_tokens_neox': 1384, 'n_words': 320}