首页 > 其他分享 >INFS3202 Web Information Systems

INFS3202 Web Information Systems

时间:2023-04-05 15:44:07浏览次数:47  
标签:Information Web INFS3202 Systems file marks php quiz1


School of Information Technology & Electrical Engineering
INFS3202/7202 Web Information Systems
1 of 4 INFS3202/7202 Web Information Systems
INFS3202/INFS7202 Web Information Systems
In-class Quiz 1:
The following conditions apply to the quiz:
• The quiz consists of FOUR tasks and is open book.
o You can use resources from the internet or lecture notes, as well as your own computer.
o The use of Generative AI tools such as ChatGPT is strictly prohibited during the quiz. Any use of such
tools will result in a score of zero for the quiz.
• It is important to write your code in the specified areas or make modifications as instructed, otherwise, your
submission will NOT be marked.
• This assessment is individual:
o You are NOT allowed to receive assistance from others by any means (e.g. instant message apps, etc.).
o You are NOT allowed to share the quiz questions with other students.
Quiz Environment Setup
• Access your zone using SSH.
• Please run the following commands if you have NOT set up the environment for the Mock Quiz before.
Otherwise, skip this step.
wget --no-check-cert https://www.dropbox.com/s/jbt6m4g97p6s1e5/quiz1mock.sh
sudo chmod +x quiz1mock.sh && ./quiz1mock.sh student_number (e.g. s4123456)
• Download the code templates by running the following commands:
wget --no-check-cert https://www.dropbox.com/s/zskf23lrha3z9e0/quiz1.sh
wget --no-check-cert https://www.dropbox.com/s/c5tomyj9lrma1ci/quiz1-submission.sh
sudo chmod +x quiz1.sh && ./quiz1.sh student_number (e.g. s4123456)
Note: quiz1.sh is to download the template php files where you need to code, while quiz1-
submission.sh is to automatically locate and zip the view and controller files, as well as the route
configuration file.
• To ensure the quiz environment is set correctly, you can access it at
o https://infs3202-xxxxxxxx.uqcloud.net/mock/quiz1
School of Information Technology & Electrical Engineering
INFS3202/7202 Web Information Systems
2 of 4 INFS3202/7202 Web Information Systems
• You may use either the built-in VS Code (https://infs3202-xxxxxxxx.uqcloud.net/vscode) or any other preferred
IDE to complete the quiz.
• In this quiz, at least php is required while vscode is recommended.
Quiz Submission
• Once you finish the quiz, you run the following code in the ssh terminal:
o sudo chmod +x quiz1-submission.sh && ./quiz1-submission.sh student_number (e.g. s4123456)
• You can also manually locate your Quiz1’s routes setting file (Routes.php), controller file (Quiz1.php) and
view files (input.php & output.php) and compress them in a zip file.
• Rename the zip file using the format sxxxxxxx_quiz1.zip, where "sxxxxxxx" represents your student number.
• Submit the renamed sxxxxxxx_quiz1.zip file to the corresponding link on Blackboard.
• Do NOT rename any of the function names in the file since auto-marking will be conducted.
• Files submitted with incorrect formatting will NOT be marked.
• Late submissions will NOT be accepted as the submission link will expire when the practical session ends.
School of Information Technology & Electrical Engineering
INFS3202/7202 Web Information Systems
3 of 4 INFS3202/7202 Web Information Systems
TASKS
Task 1 (0.5 marks)
Task description:
In this task, you are required to complete the data input in view file (input.php) by using form_open function
correctly. You are required to collect the following two variables in input boxes in the form:
• username
• message
The expected layout of the page is shown in Figure 1.
Figure 1
Task 2 (0.5 marks)
Task description:
In this task, you are required to correctly set the $routes in Config/Routes.php so that data submitted in the
view (input.php) can be appropriately sent to the controller in Quiz1.php (controller file).
School of Information Technology & Electrical Engineering
INFS3202/7202 Web Information Systems
4 of 4 INFS3202/7202 Web Information Systems
Task 3 (3.5 marks)
Task description:
In this task, you are required to complete the following subtasks in the controller file (Quiz1.php) (3.5 marks):
• Using Data Validation class to check if the input variables satisfy the rules: (0.5 marks)
o Username: The variable “username” is required and needs to be alphanumeric, with a minimum length
of 4 characters and a maximum length of 20 characters.
o Message: The variable “message” is required and needs to have a minimum length of 10 characters and
a maximum length of 1000 characters.
• If the data is NOT valid stay on the input page with relevant validation errors. (0.5 marks)
• If the data is validated, perform the following steps:
o Create a cookie containing a key-value pair ('var1', $username) (0.5 marks).
o Create a session containing a key-value pair ('var2', $message) (0.5 marks).
o Use PHP's DateTimeZone and DateTime classes to set the time zone to New York and obtain the current
date and time in the format like: 31-03-2023, 12:40:57, America/New_York. (0.5 marks)
o Convert all characters in $username to UPPERCASE. (0.5 marks)
o Pass an array of key-value pairs containing the $username (in uppercase), $time, $date, and
$timezoneName to the view file (output.php). (0.5 marks)
Task 4 (0.5 marks)
Task description:
In this task, you are required to display the data in the view file (output.php). With the array variable that
contains key-value pairs, print out the processed data one by one: $username (in upper case), $time, $date,
and $timezoneName. The expected layout of the output.php is shown in Figure 2.
Figure 2
WX:codehelp mailto: [email protected]

标签:Information,Web,INFS3202,Systems,file,marks,php,quiz1
From: https://www.cnblogs.com/qujava/p/17289556.html

相关文章