|
CS479/579 - Web Programming II
| Displaying exercises/e10/files/gradebook.php
<?php
include "config.php";
?>
<!DOCTYPE html>
<html>
<head>
<title> Gradebook </title>
<meta charset='utf-8'>
<style>
input { width: 50px; text-align: right;}
</style>
<script>
/**
* Function to use XMLHttpRequest() to update the database with the new value.
* e is the element itself. The value of the element should be replaced with
* response from the server (the updated value) to insure that the change has
* been comitted. To change the focus, find the element with the next sid and
* use the focus() method to switch the focus to it.
*/
function update(e, tid, sid) {
}
/**
* function to be called on keypress:
* ev is the event, e is the element that caused the event.
* tid and sid are the tid and sid of the element.
*/
function move(ev, e, tid, sid) {
switch(ev.code) {
case "ArrowUp":
break;
case "ArrowDown":
break;
case "ArrowLeft":
break;
case "ArrowRight":
break;
}
}
</script>
</head>
<body>
<table>
<thead>
<!-- Use PHP to print the column headings. -->
</thead>
<tbody>
<!--
Use PHP to populate the table. Place the name of each student on the left.
Structure the loop such that $sid (student id) ranges from 1 to 10 and
inside of that:
- create a new table row, then add the student name as the first column.
- make a loop to iterate over the test ids ($tid) 1-3. For each test
- create a new table data cell with an input element that has the following
attributes
- an id such as: "i$tid.$sid"
- an onchange handler that calls an update function passing it the
element itself and the tid and sid numbers for this particular cell.
- optionally it may have a onkeydown handler to move the focus from one
cell to another when the arrow keys are used by calling the move()
function.
-->
<?php
?>
</tbody>
</table>
</body>
</html>
|