<commit_before><SCRIPT LANGUAGE="JavaScript">
function toggleVis(id) { 
		var elem = document.getElementById(id+"_myDiv");
		if(elem.style.display == 'none'){
			elem.style.display = '';
			document.getElementById(id+"_show").style.display = 'none';
			document.getElementById(id+"_hide").style.display = '';
		} else {
			elem.style.display = 'none';
			document.getElementById(id+"_show").style.display = '';
			document.getElementById(id+"_hide").style.display = 'none';
		}
	} 
</SCRIPT>
<h1>View Review</h1>
<%if @assgt.wiki_type.name == "No"%>
<%if @files.size == 0%>

<%else%>
Submitted Files<br />
<%end%>
<%end%>

<%
 _time = Time.now.month.to_s + "/" + Time.now.day.to_s + "/" + Time.now.year.to_s
 if @assgt.wiki_type.name == "DokuWiki" %>
<br>
<b>DokuWiki Review Links:</b>
<br>
<br>
<%= review_dokuwiki @assgt.directory_path, _time, @author_name  %>
<br>
<% elsif @assgt.wiki_type.name == "MediaWiki" %>
<br>
<b>MediaWiki Review Links:</b>
<br>
<br>
<!--The following checks a wiki type.  If we add a new wiki type, we need to modify this code, which is in
    a very unexpected place.  This should be done by polymorphism, based on a Wiki class that is subclassed
    for various kinds of wikis. 
    
    Make a generic review_wiki function, with a parameter specifying wiki type.  The review_wiki function
    then makes callbacks to the various wiki classes, depending on what kind of a wiki it is working on.
    This allows wiki-specific behavior to be kept in the wiki classes. -->
<%if @assgt.team_assignment  # The lookup of all team members should be put in a wiki helper
  	for team_member in @team_members
		member_name = User.find(team_member.user_id).name 
	%>
		<%= review_mediawiki_group @assgt.directory_path, _time, member_name  %>
	<%end%>
<%else%>
	<%= review_mediawiki @assgt.directory_path, _time, @author_name  %>
<%end%>
<br>
<% end %>
<ul>
<% for file in @files %>
<li><%= link_to File.basename(file), :action => 'edit_review', :id => @mapping_id, :fname => File.basename(file),"current_folder[name]" => @current_folder.name %></li>
<% end %>
</ul>
<%if @assgt.team_assignment %>
	<% for team_member in @team_members %>
	<label>
	<% submitted = Participant.find(:first, :conditions =>["user_id = ? and assignment_id = ?",team_member.user_id,@assgt.id]).submitted_hyperlink
	if submitted !=nil
	%>
	URL to file submission (if available):</label><%= submitted %>
	<br/>
	<% end%>
	<% end %>
<%else %>
	<% if @link != nil %>
		Hyperlink: <a href="<%= @link %>" target="new"><%= @link %></a><br/><br/>
	<% end %>	
<%end%>	
<a href="#1" onClick="toggleVis('1');">
	<p class="inline" id="1_show" style="display: none">View review</p>
	<p class="inline" id="1_hide" >Hide review</p>
</a>

<br/>
<div id="1_myDiv" style="<%= @review_display %>">
<strong>Reviewed <%= @review.review_num_for_author %> at <%= @review.updated_at.strftime('%A %B %d %Y, %I:%M%p') %></strong>
<%= render :partial => 'review/scores' %> 
Additional Comment : <%=@review.additional_comment%><br/>
<br/>
</div>
<%
review_feedback = ReviewFeedback.find(:first,:conditions =>["review_id = ? and assignment_id = ?", @review.id, @assgt.id])
if(review_feedback) %>

<a href="#2" onClick="toggleVis('2');">
	<p class="inline" id="2_show" <% if(params[:display] == "all") %> style="display: none" <% end %> >View author feedback</p>
	<p class="inline" id="2_hide" <% if(params[:display] != "all") %> style="display: none" <% end %> >Hide author feedback</p><commit_msg>This change should preserve the whitespace when rendering @review.additional_comment in html.<commit_after><SCRIPT LANGUAGE="JavaScript">
function toggleVis(id) { 
		var elem = document.getElementById(id+"_myDiv");
		if(elem.style.display == 'none'){
			elem.style.display = '';
			document.getElementById(id+"_show").style.display = 'none';
			document.getElementById(id+"_hide").style.display = '';
		} else {
			elem.style.display = 'none';
			document.getElementById(id+"_show").style.display = '';
			document.getElementById(id+"_hide").style.display = 'none';
		}
	} 
</SCRIPT>
<h1>View Review</h1>
<%if @assgt.wiki_type.name == "No"%>
<%if @files.size == 0%>

<%else%>
Submitted Files<br />
<%end%>
<%end%>

<%
 _time = Time.now.month.to_s + "/" + Time.now.day.to_s + "/" + Time.now.year.to_s
 if @assgt.wiki_type.name == "DokuWiki" %>
<br>
<b>DokuWiki Review Links:</b>
<br>
<br>
<%= review_dokuwiki @assgt.directory_path, _time, @author_name  %>
<br>
<% elsif @assgt.wiki_type.name == "MediaWiki" %>
<br>
<b>MediaWiki Review Links:</b>
<br>
<br>
<!--The following checks a wiki type.  If we add a new wiki type, we need to modify this code, which is in
    a very unexpected place.  This should be done by polymorphism, based on a Wiki class that is subclassed
    for various kinds of wikis. 
    
    Make a generic review_wiki function, with a parameter specifying wiki type.  The review_wiki function
    then makes callbacks to the various wiki classes, depending on what kind of a wiki it is working on.
    This allows wiki-specific behavior to be kept in the wiki classes. -->
<%if @assgt.team_assignment  # The lookup of all team members should be put in a wiki helper
  	for team_member in @team_members
		member_name = User.find(team_member.user_id).name 
	%>
		<%= review_mediawiki_group @assgt.directory_path, _time, member_name  %>
	<%end%>
<%else%>
	<%= review_mediawiki @assgt.directory_path, _time, @author_name  %>
<%end%>
<br>
<% end %>
<ul>
<% for file in @files %>
<li><%= link_to File.basename(file), :action => 'edit_review', :id => @mapping_id, :fname => File.basename(file),"current_folder[name]" => @current_folder.name %></li>
<% end %>
</ul>
<%if @assgt.team_assignment %>
	<% for team_member in @team_members %>
	<label>
	<% submitted = Participant.find(:first, :conditions =>["user_id = ? and assignment_id = ?",team_member.user_id,@assgt.id]).submitted_hyperlink
	if submitted !=nil
	%>
	URL to file submission (if available):</label><%= submitted %>
	<br/>
	<% end%>
	<% end %>
<%else %>
	<% if @link != nil %>
		Hyperlink: <a href="<%= @link %>" target="new"><%= @link %></a><br/><br/>
	<% end %>	
<%end%>	
<a href="#1" onClick="toggleVis('1');">
	<p class="inline" id="1_show" style="display: none">View review</p>
	<p class="inline" id="1_hide" >Hide review</p>
</a>

<br/>
<div id="1_myDiv" style="<%= @review_display %>">
<strong>Reviewed <%= @review.review_num_for_author %> at <%= @review.updated_at.strftime('%A %B %d %Y, %I:%M%p') %></strong>
<%= render :partial => 'review/scores' %> 
Additional Comment : <br><%=@review.additional_comment.gsub(/\n/, '<br>')%><br/>
<br/>
</div>
<%
review_feedback = ReviewFeedback.find(:first,:conditions =>["review_id = ? and assignment_id = ?", @review.id, @assgt.id])
if(review_feedback) %>

<a href="#2" onClick="toggleVis('2');">
	<p class="inline" id="2_show" <% if(params[:display] == "all") %> style="display: none" <% end %> >View author feedback</p>
	<p class="inline" id="2_hide" <% if(params[:display] != "all") %> style="display: none" <% end %> >Hide author feedback</p>
{'fraction_non_alphanumeric': 0.1947405828002843, 'fraction_numerical': 0.003411513859275053, 'mean_word_length': 4.786184210526316, 'pattern_counts': {'":': 0, '<': 179, '<?xml version=': 0, '>': 193, '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': '7432736', 'n_tokens_mistral': 2714, 'n_tokens_neox': 2495, 'n_words': 632}