-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheckid.php
44 lines (38 loc) · 1.05 KB
/
checkid.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
<?php
// 実験WebPage created by Wakayama Univ. AMLAB
// 実験参加者のチェック
// echo "<script>console.log('この参加者のIDは、$id');</script>";
$error = 0;
// 参加をお断りする人をチェック
foreach(glob("./result/id_reject.csv") as $filename) {
$file = fopen($filename, "r");
while(($sbjdata = fgetcsv($file)) !== false) {
$sbjid = $sbjdata[0];
if(strcmp($sbjid, $id) == 0){
$error = 1;
break;
}
}
fclose($file);
}
// Task2以降、前タスク参加者かチェック
if($task_num != 1){
foreach(glob("./result/id_sndlevel.csv") as $filename) {
$file = fopen($filename, "r");
$error = 2;
while(($sbjdata = fgetcsv($file)) !== false) {
$sbjid = $sbjdata[0];
if(strcmp($sbjid, $id) == 0){
$error = 0;
$sndlevel = $sbjdata[1];
break;
}
}
fclose($file);
}
}
// 実験途中でないかチェック
foreach(glob("./result/". $id. "/") as $result) {
$error = 3;
}
?>