-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.tpl.php
107 lines (97 loc) · 4.19 KB
/
view.tpl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<div class="maincontent generalbox">
<h1 class="name"><?php echo $programming->name; ?></h1>
<?php if ($programming->showmode == PROGRAMMING_SHOWMODE_NORMAL):?>
<div class="grade"><?php echo get_string('grade').': '.$programming->grade; ?> / <?php echo get_string('discount', 'programming').': '.$programming->discount/10.0; ?></div>
<?php else: ?>
<div>
<?php echo get_string('timelimit', 'programming'); ?>:
<?php echo programming_format_timelimit($programming->timelimit); ?>
<?php echo get_string('memlimit', 'programming'); ?>:
<?php echo programming_format_memlimit($programming->memlimit); ?>
</div>
<?php endif; ?>
<div id="description">
<?php echo format_text($programming->description, $programming->descformat); ?>
</div>
<?php if (is_array($datafiles)) : ?>
<div id="datafile">
<h2><?php echo get_string('datafile', 'programming'); ?></h2>
<ul>
<?php foreach ($datafiles as $datafile): ?>
<li><a href="datafile/download.php?a=<?php echo $datafile->programmingid; ?>&id=<?php echo $datafile->id; ?>" title="<?php echo get_string('presstodownload', 'programming'); ?>"><?php echo $datafile->filename; ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php if (is_array($presetcodes)) : ?>
<div id="presetcode">
<h2><?php echo get_string('presetcode', 'programming'); ?></h2>
<?php foreach ($presetcodes as $pcode): ?>
<h3><?php echo programming_get_presetcode_name($pcode); ?></h3>
<textarea rows="20" cols="60" name="code" class="c#" id="code"><?php echo htmlspecialchars(programming_format_presetcode($pcode)); ?></textarea>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($viewpubtestcase && $programming->showmode == PROGRAMMING_SHOWMODE_NORMAL && count($pubtests) > 0): ?>
<div id="testcase-table">
<table class="generaltable">
<tr>
<th> </th>
<th><?php echo get_string('input', 'programming'); helpbutton('input', 'input', 'programming'); ?></th>
<th><?php echo get_string('expectedoutput', 'programming'); helpbutton('expectedoutput', 'expectedoutput', 'programming'); ?></th>
<th><?php echo get_string('timelimit', 'programming'); helpbutton('timelimit', 'timelimit', 'programming'); ?></th>
<th><?php echo get_string('memlimit', 'programming'); helpbutton('memlimit', 'memlimit', 'programming'); ?></th>
<th><?php echo get_string('extraproc', 'programming'); helpbutton('nproc', 'nproc', 'programming'); ?></th>
</tr>
<?php
$i = 0; $ioid = 0;
foreach ($pubtests as $programmingtest):
?>
<tr>
<th><?php echo get_string('testcasen', 'programming', $programmingtest->seq); ?></th>
<td class="programming-io cell">
<?php echo "<a href='testcase/download_io.php?a={$programming->id}&test={$programmingtest->id}&type=in&download=0' class='showasplaintext small'>$strshowasplaintext</a>"; ?>
<?php echo programming_format_io($programmingtest->input, true); ?>
</td>
<td class="programming-io cell">
<?php echo "<a href='testcase/download_io.php?a={$programming->id}&test={$programmingtest->id}&type=out&download=0' class='showasplaintext small'>$strshowasplaintext</a>"; ?>
<?php echo programming_format_io($programmingtest->output, true); ?>
</td>
<td class="cell">
<?php echo programming_format_timelimit($programmingtest->timelimit); ?>
</td>
<td class="cell">
<?php echo programming_format_memlimit($programmingtest->memlimit); ?>
</td>
<td class="cell">
<?php echo $programmingtest->nproc; ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<?php endif; ?>
<?php if ($programming->showmode == PROGRAMMING_SHOWMODE_NORMAL):?>
<div id="time-table">
<table class="generaltable">
<tr>
<th><?php echo get_string('timeopen', 'programming'); ?></th>
<td class="cell"><?php echo userdate($programming->timeopen); ?></td>
</tr>
<tr>
<th><?php echo get_string('timediscount', 'programming'); ?></th>
<td class="cell"><?php echo userdate($programming->timediscount); ?></td>
</tr>
<tr>
<th><?php echo get_string('timeclose', 'programming'); ?></th>
<td class="cell"><?php echo userdate($programming->timeclose); ?></td>
</tr>
</table>
<p align="center">
<?php echo get_string('allowlate', 'programming'); ?>:
<?php echo get_string($programming->allowlate ? 'yes' : 'no'); ?>
</p>
</div>
<?php endif; ?>
</div>