ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions
13 marks · Web technologies
Explain why server-side scripting has been used to produce the statistics as shown on the web page above. The website makes use of Cascading Style Sheets (CSS) The text ‘Glasgow Statistics’ is an H1 heading. Write a CSS rule that makes H1 headings appear in Arial, centre aligned and green. Describe how CSS rules should be implemented to ensure that all of the web pages on the website have consistent formatting. When the user places their mouse on the image of Glasgow’s coat of arms it increases in size as shown below. When the mouse is moved away from the image, the image returns to its normal size. Home Statistics Index Maps Help Glasgow Search Home Statistics Index Maps Help Glasgow Search Glasgow Statistics Glasgow Statistics Current Population: 603,080 Current Population: 603,080 Local Dialling Code: 0141 Local Dialling Code: 0141 Postal Code: G1 - G80 Postal Code: G1 - G80 Glasgow: city in Scotland Glasgow: city in Scotland Complete the four missing lines of code to allow the: • Function Increase() to triple the width and height of the graphic when the user moves the mouse pointer over the image • Function Normal() to return the image to its original size when the user moves the mouse pointer off the image. <!DOCTYPE html> <html> <body> <img onmouseover=”Increase(this)” onmouseout=”________________” src=”Glasgow.png” width=”32” height=”32”> <script> function Increase(x) { x.style.width = “96px”; ________________ } function Normal(x) { ________________ ________________ } </script> </body> </html> The user tries to find statistics for Aberdeen. However, they typed “Aberdene” into the text box and the following web page was displayed. Aberdene Statistics Results of Search for “Aberdene” Sorry, we found no match for your location Home Statistics Index Maps Help Aberdene Search Explain how this database-driven website uses server-side scripting to produce the output above. A tourist website has a web page which displays statistics about towns and cities. The user enters a name in the text box and clicks on the search button to display the statistics. Glasgow Statistics Current Population: 603,080 Local Dialling Code: 0141 Postal Code: G1 - G80 Glasgow: city in Scotland Home Statistics Index Maps Help Glasgow Search
• Database (holding city data) is not stored locally. • Database must be accessed/ queried from (remote) server. • Client (browser) cannot access database directly. 1 mark for any one bullet H1 with open and close bracket. (1 mark) AND Any two from three correct elements with appropriate attribute for 1 mark each. (maximum 2 marks) H1 {font-family: Arial; text-align: center; color: green } Do not accept colour or centre • Use external style sheet/ create a file with CSS rules. • Create a link tag to external stylesheet. • Place link to external stylesheet in all web pages. 1 mark for each bullet. Maximum 2 marks • Normal(this) (1 mark) • x.style.height = "96px"; (1 mark) 1 mark for both bullets: • x.style.height = "32px" • x.style.width = "32px"; • Text in form assigned to variables. • Connection with server/ database established. • Database selected. • (Form data used to) construct (SQL) query/query is run. • Results of query returned from server. • Code (PHP) processes result to generate appropriate output. 1 mark for each bullet. Maximum 4 marks
Previous question: Higher Computing Science 2018 Question 12 (CfE)
Next question: Higher Computing Science 2018 Question 14 (CfE)