CP311 - Internet Programming and Applications II

Continuous Assessment Registration System


Question: The University of Dodoma wants to modify the continuous assessment (CA) registration form so that it appears like the one shown in figure 1. The course instructor can use it to register CA for more than two students by clicking the add Row button to append the row. The appended row may be deleted by clicking the delete Row button. You are required to create a form using XHTML, ajax and PHP. The submit button should save the information on the ca result table in the database udom_sr.

Table structure: Tbl student(student_id,test_one,test_two) Tbl_ca_results(student_id,test_one,test_two) (15 Marks)


Arithmetic Practice Program

QN2: a) Computers are playing an increasing role in education, use XHTML, and JavaScript to write a program that will help an elementary school student learn multiplications. Use random function to produce two positive one digit integer, it should then display a question such as, how much is 4 times 9? The student then type the answer into a text field your program checks the student’s answer if it is correct, display the string “very good” and generate a new question. If the answer is wrong, display the string “no please try again” and let the student try the same question again repeatedly until the student finally gets it right. A separate function should be used to generate each new question. This function should be called once when the script begins execution and each time the user answers the question correctly. (10 Marks)


b) modify the program from question one to allow the user to pick the type of arithmetic problem he or she wishes to study. An option of 1 means addition problem only. 2 means subtraction problem only. 3 means multiplication problem only. 4 means division problem only and 5 means to execute randomly of all these types. (10 Marks)


PHP Code Analysis

QN3. What is the value displayed when the following is executed? Assume that the code was executed using the following URL. testscript.php?c=25

<?php
function process($c,$d=25){
    $retval=$c+$d=$_GET['C']
    Return $retval;
}
echo process(5.30);
?>

(5 Marks)