summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-06-08 15:45:58 +0200
committerPatrick Simianer <p@simianer.de>2016-06-08 15:45:58 +0200
commitec76c2c915ab02cbb06934c7dfeb109f00dcea3c (patch)
tree9b0bcfb4f304c4991fa000c34a2742aab9a3240c
parent457ab6312a19281e1c33b54411cb13878913e774 (diff)
over-engineering
-rw-r--r--index.php44
-rw-r--r--pool.php6
-rwxr-xr-xutil/run_all3
3 files changed, 40 insertions, 13 deletions
diff --git a/index.php b/index.php
index 4aed520..320e653 100644
--- a/index.php
+++ b/index.php
@@ -3,6 +3,9 @@
<meta charset="utf-8" />
<title>Post-Editing Interface</title>
<script src="js/jquery.min.js" charset="utf-8"></script>
+ <script type="text/javascript">
+
+ </script>
<link rel="stylesheet" type="text/css" href="static/main.css" />
</head>
@@ -12,10 +15,10 @@
<form method="get" action="interface.php">
<strong>Please enter your session key:</strong>
- <input type="text" id="key" name="key" style="width:20em" />
+ <input type="text" id="key" name="key" style="width:8em" />
&nbsp;&nbsp;&nbsp;&nbsp;Session type:
<select name="ui_type">
- <option value="g">graphical</option>
+ <!--<option value="g">graphical</option>-->
<option value="t">text</option>
</select>
&nbsp;&nbsp;&nbsp;
@@ -23,10 +26,34 @@
</form>
<!--<div class="small" style="background:#eee;margin: 5em 0 5em 0;padding:.5em; max-width:25%">
-<p>Select:
-<select class="small">
- <option value="g0_0_nomt" onclick="document.getElementById('key').value=this.value;">#0 (from scratch)</option>
+
+<?php
+//if ($_GET['manual']) {
+echo "<p>Select session: ";
+echo "<select class='small'>";
+
+ $f = fopen("../sessions/sessions", "r");
+ $a = array();
+ while (($line = fgets($f)) !== false) {
+ $x = explode("\t", $line, 4);
+ $a[$x[3]] = $x[0];
+ }
+ fclose($f);
+
+ asort($a);
+
+ foreach ($a as $key => $val) {
+ echo "<option value='".$val."' onclick=\"document.getElementById('key').value=this.value;\">Session ".$key."</option>";
+ }
+ echo "</select></p>";
+//} else {
+// echo '<p style="padding:1em"><a style="font-size:1.2em;color:#000" href="pool.php">Assignment</a></p><p><a href="?manual=1">Manual</a>';
+//}
+?>
+-->
+
+<!-- <option value="g0_0_nomt" >#0 (from scratch)</option>
<option value="g0_0_pe" onclick="document.getElementById('key').value=this.value;">#0 (post-editing)</option>
<optgroup label="________________"></optgroup>
<option value="g0_1_nomt" onclick="document.getElementById('key').value=this.value;">#1 (from scratch)</option>
@@ -133,11 +160,10 @@
<option value="product_en-de_beta_test_1_D" onclick="document.getElementById('key').value=this.value;">D* en-de</option>
</optgroup>-->
-<!--</select>
-</p>
-</div>-->
-<a style="font-size:1.2em;color:#000" href="pool.php">Assignment</a>
+
+</div>
+
<?php include("inc/footer.inc.php"); ?>
diff --git a/pool.php b/pool.php
index ad8de29..bce819c 100644
--- a/pool.php
+++ b/pool.php
@@ -11,7 +11,7 @@
</head>
<body>
- <p style='margin:2em;color:#000'><strong>Click on a table cell, enter your name, and click 'Begin' to begin your session. Reload the page if you clicked on the wrong cell.</strong></p>
+ <p style='margin:2em;color:#000'><strong>Click on a table cell, enter your name, and click 'Begin' to begin your session. Reload the page if you clicked on the wrong cell or if the session is already used by someone else.</strong></p>
<table border=1 style="margin-left:10%">
<tr><td>#0</td></tr>
</table>
@@ -41,8 +41,8 @@
$max = $j;
}
}
- fclose($f);
-
+ fclose($f);
+
for ($i=1; $i<=$max; $i++) {
echo "<td class='item' session='".$b[$i]."' id='item".$i."'>#".$i."<br /><span style='font-size:.5em'>".$b[$i]."</span></td>\n";
if ($i%5 == 0) {
diff --git a/util/run_all b/util/run_all
index 2fc511c..801d553 100755
--- a/util/run_all
+++ b/util/run_all
@@ -1,6 +1,7 @@
#!/bin/zsh -x
-for i in `find ../sessions -maxdepth 1 | cut -d "/" -f 3 | grep -P "^session_"`; do
+#for i in `find ../sessions -maxdepth 1 | cut -d "/" -f 3 | grep -P "^sess_"`; do
+for i in `cat ../sessions/sessions | cut -f 1`; do
echo $i
./util/run_server $i &
done