<commit_before><% ajax_scribble = nil %>

<%# Create hidden fields for each non-answer scribble %>
<% answer.scribbles.each do |scribble| %>
	<% is_scribble_unlocked = (scribble.std_course == curr_user_course) %>
	<% ajax_scribble = scribble if is_scribble_unlocked %>
	<%= hidden_field('scribbles', scribble.id,
			class: 'scribble-' + qid.to_s,
			value: scribble.content,
			"data-locked" => (is_scribble_unlocked ? "false" : "true"),
			"data-scribe" => scribble.std_course.name) %>
<% end %>

<%# Create hidden fields for answer scribble %>
<% is_ans_unlocked = (answer.std_course == curr_user_course) %>
<%= hidden_field('answers', qid, value: answer.content,
		"data-locked" => (is_ans_unlocked ? "false" : "true"),
		"data-scribe" => answer.std_course.name) %>

<%# Ajax submission data%>
<% if !is_ans_unlocked and edit_mode %>
	<div id='scribing-ajax-<%= qid %>'
		data-std-course-id = '<%= curr_user_course.id %>'
		data-scribing-answer-id = '<%=  answer.as_answer_id %>'
		data-id = '<%= ajax_scribble.id if ajax_scribble %>'
		data-content = '<%= ajax_scribble.content if ajax_scribble %>'></div>
<% end %>

<div class="container-fluid" id="scribing-container-<%= qid %>">
	<div class="row-fluid">
		<div class="span12">
			<div class="btn-toolbar">
				<div class="btn-group" id="scribing-buttons-<%= qid %>">

					<% if edit_mode %>
						<a class="btn active" title="Enter Edit Mode" id="edit-mode-<%= qid %>">
							<i class="icon-hand-up"></i>
						</a>
						<a class="btn" title="Enter Scribing Mode" id="scribing-mode-<%= qid %>">
							<i class="icon-pencil"></i>
						</a>
					<% end %>

					<a class="btn" title="Enter Grab Mode" id="grab-mode-<%= qid %>">
						<i class="icon-move"></i>
					</a>
				</div>
				<div class="btn-group">
					<a class="btn" title="Zoom in" id="scribing-zoom-in-<%= qid %>">
						<i class="icon-zoom-in"></i>
					</a>
					<a class="btn" title="Zoom out" id="scribing-zoom-out-<%= qid %>">
						<i class="icon-zoom-out"></i>
					</a>
				</div>
				<div class="btn-group">
				  <select class="selectpicker show-tick dropdown-trigger-on-hover" multiple="multiple" title="Layers" data-selected-text-format="count" data-width="auto" id="scribing-layers-<%= qid %>" data-header="Show / hide layers">
				  </select>
				</div>
				<div class="btn-group <%= edit_mode ? '' : 'hidden' %>" id="scribing-edit-tools-<%= qid %>">
					<a class="btn" title="Delete Selection" id="scribing-delete-<%= qid %>">
						<i class="icon-trash"></i>
					</a>
				</div>
				<div class="btn-group hidden" id="scribing-drawing-tools-<%= qid %>">
					<div class="panel">
	          <input type="text" class="scribing-color-val" id="scribing-color-<%= qid %>"></input>
				    <input type="range" id="scribing-width-<%= qid %>" value="2" min="0" max="30" style="width: 100px"></input>
			    </div>
				</div>
			</div>
			<canvas class="scribing-canvas"
			        id="scribing-canvas-<%= qid %>"
							style="border:1px solid black;"
							width=900
							height=1272
							data-qid="<%= qid %>"
							></canvas>
			<% if question.document %>
			  <img style="display: none;" class="scribing-images"
			        src="<%= question.document.file.to_s %>"
			        data-qid="<%= qid %>"
			        ></img>

			<% end %>
		</div>
	</div>
</div>




<commit_msg>Improve formatting<commit_after><% ajax_scribble = nil %>

<%# Create hidden fields for each non-answer scribble %>
<% answer.scribbles.each do |scribble| %>
  <% is_scribble_unlocked = (scribble.std_course == curr_user_course) %>
  <% ajax_scribble = scribble if is_scribble_unlocked %>
  <%= hidden_field('scribbles', scribble.id,
      class: 'scribble-' + qid.to_s,
      value: scribble.content,
      "data-locked" => (is_scribble_unlocked ? "false" : "true"),
      "data-scribe" => scribble.std_course.name) %>
<% end %>

<%# Create hidden fields for answer scribble %>
<% is_ans_unlocked = (answer.std_course == curr_user_course) %>
<%= hidden_field('answers', qid, value: answer.content,
    "data-locked" => (is_ans_unlocked ? "false" : "true"),
    "data-scribe" => answer.std_course.name) %>

<%# Ajax submission data%>
<% if !is_ans_unlocked and edit_mode %>
  <div id='scribing-ajax-<%= qid %>'
    data-std-course-id = '<%= curr_user_course.id %>'
    data-scribing-answer-id = '<%=  answer.as_answer_id %>'
    data-id = '<%= ajax_scribble.id if ajax_scribble %>'
    data-content = '<%= ajax_scribble.content if ajax_scribble %>'></div>
<% end %>

<div class="container-fluid" id="scribing-container-<%= qid %>">
  <div class="row-fluid">
    <div class="span12">
      <div class="btn-toolbar">
        <div class="btn-group" id="scribing-buttons-<%= qid %>">

          <% if edit_mode %>
            <a class="btn active" title="Enter Edit Mode" id="edit-mode-<%= qid %>">
              <i class="icon-hand-up"></i>
            </a>
            <a class="btn" title="Enter Scribing Mode" id="scribing-mode-<%= qid %>">
              <i class="icon-pencil"></i>
            </a>
          <% end %>

          <a class="btn" title="Enter Grab Mode" id="grab-mode-<%= qid %>">
            <i class="icon-move"></i>
          </a>
        </div>
        <div class="btn-group">
          <a class="btn" title="Zoom in" id="scribing-zoom-in-<%= qid %>">
            <i class="icon-zoom-in"></i>
          </a>
          <a class="btn" title="Zoom out" id="scribing-zoom-out-<%= qid %>">
            <i class="icon-zoom-out"></i>
          </a>
        </div>
        <div class="btn-group">
          <select class="selectpicker show-tick dropdown-trigger-on-hover"
            multiple="multiple"
            title="Layers"
            data-selected-text-format="count"
            data-width="auto"
            id="scribing-layers-<%= qid %>"
            data-header="Show / hide layers">
          </select>
        </div>
        <div class="btn-group <%= edit_mode ? '' : 'hidden' %>" id="scribing-edit-tools-<%= qid %>">
          <a class="btn" title="Delete Selection" id="scribing-delete-<%= qid %>">
            <i class="icon-trash"></i>
          </a>
        </div>
        <div class="btn-group hidden" id="scribing-drawing-tools-<%= qid %>">
          <div class="panel">
            <input type="text" class="scribing-color-val"
              id="scribing-color-<%= qid %>">
            </input>
            <input id="scribing-width-<%= qid %>"
              type="range" style="width: 100px"
              value="2" min="0" max="30" >
            </input>
          </div>
        </div>
      </div>
      <canvas class="scribing-canvas"
        id="scribing-canvas-<%= qid %>"
        style="border:1px solid black;"
        width=900
        height=1272
        data-qid="<%= qid %>">
      </canvas>
      <% if question.document %>
        <img style="display: none;" class="scribing-images"
          src="<%= question.document.file.to_s %>"
          data-qid="<%= qid %>">
        </img>
      <% end %>
    </div>
  </div>
</div>





{'fraction_non_alphanumeric': 0.20483478758403662, 'fraction_numerical': 0.004863395794593048, 'mean_word_length': 2.6303219106957423, 'pattern_counts': {'":': 0, '<': 195, '<?xml version=': 0, '>': 203, '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': '6202641', 'n_tokens_mistral': 2819, 'n_tokens_neox': 2404, 'n_words': 466}