Commit d30ee878 authored by Antonios Angelakis's avatar Antonios Angelakis

Add many figures,listings

parent 97ce1560
{
"numberOfTests": 4,
"numberOfGroups": 3,
"testNameFormatInput": "onemore1.in%d",
"testNameFormatOutput": "onemore1.out%d",
"groups": [
{
"name": "Group 1",
"points": 4,
"tests": [
{
"number": 1,
"mode": "blue"
}
]
},
{
"name": "Group 2",
"points": 7,
"tests": [
{
"number": 1,
"mode": "yellow"
},
{
"number": 2,
"mode": "green"
},
{
"number": 3,
"mode": "blue"
}
]
},
{
"name": "Final",
"points": 20,
"tests": [
{
"number": 1,
"mode": "green"
},
{
"number": 2,
"mode": "green"
},
{
"number": 3,
"mode": "green"
},
{
"number": 4,
"mode": "green"
}
]
}
]
}
<pre><font color="#0000AA"><b>#</b></font> <font color="#00AAAA">grader </font><font color="#AAAAAA">@ </font><font color="#00AA00">debian </font><font color="#AAAAAA">in </font><font color="#AA5500"><b>~/hellenico/kewii</b></font> <font color="#AAAAAA">on</font> git:<font color="#00AAAA">mysql-to-PDO </font><font color="#AA0000">x</font> <font color="#AAAAAA">[21:35:50] </font>
<font color="#AA0000"><b>$ </b></font><u>python generatejson.py </u>
How many tests would you like to upload? (Default: 0): <u>4</u>
What is the name format of the testcases input? (Default: probname.in%d): <u>onemore1.in%d</u>
What is the name format of the testcases output? (Default: probname.out%d): <u>onemore1.out%d</u>
How many groups would you like to create? (Default: 0): <u>3</u>
Would you like to describe the groups? [Y/n]:
New group (1/3)
How will be the new group named? [optional]: <u>Group 1</u>
How many points will it be worth? [optional]: <u>4</u>
Input a string describing what tests should be included in this group. An example would be: &quot;1y 3b 4o 7g&quot;, to have 1 in yellow mode, 3 in blue, 4 orange and 7 green
<u>1y 2b</u>
New group (2/3)
How will be the new group named? [optional]: <u>Group 2</u>
How many points will it be worth? [optional]: <u>10</u>
Input a string describing what tests should be included in this group. An example would be: &quot;1y 3b 4o 7g&quot;, to have 1 in yellow mode, 3 in blue, 4 orange and 7 green
<u>2o 3o</u>
New group (3/3)
How will be the new group named? [optional]: <u>Group 3</u>
How many points will it be worth? [optional]: <u>15</u>
Input a string describing what tests should be included in this group. An example would be: &quot;1y 3b 4o 7g&quot;, to have 1 in yellow mode, 3 in blue, 4 orange and 7 green
<u>1g 2g 3g 4g</u>
./descriptor.json has been created
You should now create a zip archive containing descriptor.json and test files
</pre>
<?php
$user = "root";
$pass = "root";
$dsn = "mysql:host=localhost;dbname=test";
$charset = "utf8";
$dbh = new PDO('mysql:host=localhost;dbname=test;charset=$charset', $user, $pass);
?>
<?php
$query = "SELECT * FROM foo WHERE bar = " . $db->quote($zip);
$result = $db->query($query);
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
print_r($row);
}
?>
<?php
$stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)");
$stmt->bindParam(':name', $name);
$stmt->bindParam(':value', $value);
// insert one row
$name = 'one';
$value = 1;
$stmt->execute();
// insert another row with different values
$name = 'two';
$value = 2;
$stmt->execute();
?>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment