<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html metal:use-macro="container/page_macro/macros/master_page">

<span tal:omit-tag="" metal:fill-slot="main_content_slot">
	<span tal:omit-tag="" tal:condition="exists:request/uname">
		<span tal:omit-tag="" tal:define="global username request/uname" />
	</span>
	<span tal:omit-tag="" tal:condition="not:exists:request/uname">
		<span tal:omit-tag="" tal:define="global username python:str(user)" />
	</span>
	<label tal:omit-tag="" i18n:translate="">Grading</label>

	<span tal:condition="python:username==str(user) or context.kas_opetaja(request)"><!--check start>-->
	<h2 i18n:translate="">Grading</h2>
		<form method="post" action="assignmentGrading_handler">
		<input type="hidden" value="" name="user" tal:attributes="value username" />
		<table border="0">
			<tr>
				<td colspan="2" tal:condition="python:context.tyyp!=2"><label i18n:translate="">Grade for user <label i18n:name="uname" tal:replace="python:context.firstAndLast(username)"/> </label></td>
				<td colspan="2" tal:condition="python:context.tyyp==2"><label i18n:translate="">Grade for group <label i18n:name="grname" tal:replace="username" /></label>
				<br />
				<label class="helpLabel" i18n:translate="">Note: Each member of this group will have the same grade initially.</label>
				</td>
			</tr>
			<tr>
				<td i18n:translate="">Points:</td>
				<td tal:condition="python:context.kas_opetaja(request)">
					<input type="text" name="points" value="" tal:attributes="value python:context.getGrades(username, 'points')" />
				</td>
				<td tal:condition="python:not(context.kas_opetaja(request))" tal:content="python:context.getGrades(username, 'points')" />
			</tr>
			<tr>
				<td i18n:translate="">Comment:</td>
				<td tal:condition="python:context.kas_opetaja(request)"><textarea name="comment" tal:content="python:context.getGrades(username, 'comment')"></textarea></td>
				<td tal:condition="python:not(context.kas_opetaja(request))" tal:content="python:context.getGrades(username, 'comment')"></td>
			</tr>
			<tr tal:condition="python:context.kas_opetaja(request)">
				<td colspan="2"><input i18n:attributes="value" type="submit" value="Save" name="save" /></td>
			</tr>
		</table>
		</form>
	</span><!-- check end-->
	<h2 i18n:translate="">Assignment information</h2>
	
	<h3 i18n:translate="">Assignment:</h3> <label tal:replace="context/getTitle" />
	
	<h3 i18n:translate="">Type:</h3> <label tal:replace="python:context.getType(request)" />
	
	<h3 i18n:translate="">Max:</h3> <label tal:replace="context/getPoints" />
	
	<h3 i18n:translate="">Description:</h3>
	<p tal:content="context/kirjeldus" />

	<h3 i18n:translate="" tal:condition="python:context.tyyp==4">Your match</h3>
	<p>
	<span tal:repeat="rw python:context.getReviewers(curUser.get_uname())">
		<a href="" tal:omit-tag="python:not(context.getLinkToAssignment(rw,kursus.get_id(),context.getAssignmentID()))" tal:attributes="href python:context.getLinkToAssignment(rw,kursus.get_id(),context.getAssignmentID())">
			<label tal:replace="python:context.firstAndLast(rw)" />
		</a>
		<br tal:condition="not:repeat/rw/end" />
	</span>
	</p>
	
</span>
  
</html>
