<!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">

			&gt; grade assignments

			<form action="manage_gradeAssignment_handler" method="post">
			<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#EEEEEE">
				<tr>
					<td i18n:translate="">Title:</td>
					<span tal:repeat="hw context/listAssignments" tal:omit-tag="">
						<th tal:content="hw/getTitle" />
					</span>
					<th i18n:translate="">Points</th>
					<th i18n:translate="">Grade</th>
					<th i18n:translate="">Comment</th>
					<tr>
						<td class="t1" i18n:translate="">Max:</td>
						<span tal:repeat="hw context/listAssignments" tal:omit-tag="">
							<td class="t1" tal:content="hw/getPoints"></td>
						</span>
						<td class="t1" tal:content="context/kodutood/normpunktideSumma"></td>
						<td class="t1">
							<a href="#" tal:attributes="href python:context.kodutood.absolute_url()+'/'" i18n:translate="">Scale</a>
						</td>
						<td class="t1">&nbsp;</td>
					</tr>
					<tr>
						<td i18n:translate="">Type:</td>
						<span tal:repeat="hw context/listAssignments" tal:omit-tag="">
							<td tal:content="python:hw.getType(request)"></td>
						</span>
						<td>&nbsp;</td><td>&nbsp;</td>
					</tr>
					<!-- XXX:should be thrown out! -->
					<tr tal:repeat="user context/get_all_users">

						<span tal:omit-tag="" 
							tal:define="global koondArvutus python:float(0);
										username python:user.get_id(); 
										">
						
						<td class="t1">
							<a href="" tal:attributes="href python:user.absolute_url()+'/webtop/c'+jnr+'/course_info_user'" tal:content="python:user.firstAndLast(username)"></a>
						</td>
						
						<span tal:repeat="hw context/listAssignments" tal:omit-tag="">
    						<span tal:define="global koondArvutus python:hw.getGrades(username, 'points')+koondArvutus">
    						<td class="t1">
								<a href=""
									tal:condition="python:hw.tyyp==1" 
									tal:attributes="href python:user.absolute_url()+'/webtop/c'+jnr+'/esitlused/'+hw.get_id()"
									>Vaata</a>
<!--								<a href=""
									tal:condition="python:hw.tyyp==2" 
									tal:attributes="href python:user.absolute_url()+'/webtop/c'+jnr+'/esitlused/'+hw.get_id()"
									>Vaata</a>-->
    							<br />
    							<input size="4" type="text" name="hinne:float" value="" tal:attributes="value python:hw.getGrades(username, 'points');name python:hw.get_id()+'__'+username+'__points'" />
    							<br />
    							<input size="4" type="text" name="opkomm" value="" tal:attributes="value python:hw.getGrades(username, 'teacherComment');name python:hw.get_id()+'__'+username+'__teacherComment'" />
    							<br />
<!--    							St.kom:<input size="4" type="text" name="stkomm" value="" tal:attributes="value python:hw.getGrades(username, 'comment');name python:hw.get_id()+'__'+username+'__comment'" />-->
    						</td>
    						
    						<span tal:omit-tag="" tal:condition="repeat/hw/end">
    							<td class="t1">
									<label tal:replace="koondArvutus" />
    								<br />
    								<input size="4" type="text" name="points" value="points" tal:attributes="name python:username+'__TotPoints';value python:hw.getOverallDetails(username, 'TotPoints')" />
    								<br />
    								<input size="4" type="text" name="points" value="points" tal:attributes="name python:username+'__TotPointsCom';value python:hw.getOverallDetails(username, 'TotPointsCom')" />
    							</td>
    							<td class="t1">
									<label 
										tal:condition="python:context.punktideleVastavHinne(request, hw.getOverallDetails(username, 'TotPoints'))!=''" 
										tal:replace="python:context.punktideleVastavHinne(request, hw.getOverallDetails(username, 'TotPoints'))" />
    								<label 
										tal:condition="python:context.punktideleVastavHinne(request, hw.getOverallDetails(username, 'TotPoints'))==''" 
										tal:replace="python:context.punktideleVastavHinne(request, koondArvutus)" />
    								<br />
    								<input size="4" type="text" name="points" value="grade" tal:attributes="name python:username+'__grade';value python:hw.getOverallDetails(username, 'grade')" />
    								<br />
    								<input size="4" type="text" name="points" value="grade" tal:attributes="name python:username+'__gradeCom';value python:hw.getOverallDetails(username, 'gradeCom')" />
    							</td>
    							<td class="t1">
    								<textarea name="overallComment" tal:attributes="name python:username+'__overallComment'" tal:content="python:hw.getOverallDetails(username,'overallComment')" />
    							</td>
    						</span>
    						
    						</span>
						</span>
						</span>
					</tr>
					<tr>
						<td colspan="4">
							<input type="checkbox" name="kas_emailida" value="kas_emailida">
							<label tal:omit-tag="" i18n:translate="">Also send grades via email</label>
							<br />
							<input type="submit" value="Salvesta" i18n:attributes="value" >
						</td>
					</tr>
			</table>
			</form>
			<a href="kysiCSV">Save grades as .csv file</a>
			<a href="kasutajateKodutoodeArhiiv">Archive assignments</a>

 </span> 
</html>
