Practice IB Computer Science (CS) Topic C.1 Creating the Web with authentic exam-style questions for both SL and HL students. This question bank focuses on the exact syllabus content for C.1 Creating the Web and mirrors Paper 1, 2, 3 style where relevant.
Get instant solutions, detailed explanations, and build confidence with questions aligned to IB examiner expectations.
The following information relates to ScholarSearch, an online academic repository that allows researchers to browse and download journals.
Users access the repository through the following URL:
http://scholarsearch.net/archive/search.php
When a user submits a search, the following PHP script processes the request to filter the library's catalog:
<?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $vol_id = $_POST['volume_number']; $dept = $_POST['department_code']; <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">r</span><span class="mord mathnormal">es</span><span class="mord mathnormal">u</span><span class="mord mathnormal" style="margin-right:0.0197em;">l</span><span class="mord mathnormal">t</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">se</span><span class="mord mathnormal">a</span><span class="mord mathnormal" style="margin-right:0.0278em;">r</span><span class="mord mathnormal">c</span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">c</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">a</span><span class="mord mathnormal">t</span><span class="mord mathnormal">a</span><span class="mord mathnormal" style="margin-right:0.0197em;">l</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.0359em;">g</span><span class="mopen">(</span></span></span></span>vol_id, $dept); }?>The repository uses a standard template for its headers to maintain a professional appearance across the portal. The web server handles thousands of requests daily for both static documents (PDFs) and dynamic search results.
A user fills out a search form on the ScholarSearch website to find specific journals. Based on the provided PHP code, identify the two specific items of information that the user has submitted to the server.
Outline the role of the <head> section within the HTML structure of the ScholarSearch web pages.
The ScholarSearch developers have included a robots.txt file in the root directory of the server. Describe how this file affects the behavior of web crawlers.
Consider the following fragment of code used to generate the site's navigation menu dynamically:
$sections = ["Archive", "Submit", "Contact"];foreach ($sections as $title) { <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">s</span><span class="mord mathnormal" style="margin-right:0.0197em;">l</span><span class="mord mathnormal" style="margin-right:0.0359em;">ug</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">s</span><span class="mord mathnormal">t</span><span class="mord mathnormal" style="margin-right:0.0278em;">r</span><span class="mord mathnormal">t</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.0197em;">l</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="mord mathnormal" style="margin-right:0.0278em;">er</span><span class="mopen">(</span></span></span></span>title) . ".php"; echo "<a href='<span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9463em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">s</span><span class="mord mathnormal" style="margin-right:0.0197em;">l</span><span class="mord mathnormal">u</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">g</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">></span></span></span></span>title</a> ";}Explain the function of this code fragment in the context of generating a web page.
Identify the steps involved in the standard HTTP request-response cycle when a browser requests a static file, such as logo.png, from the ScholarSearch server.
MetroPulse is a digital news agency that hosts an extensive online archive of historical newspaper articles.
To ensure a professional and uniform appearance across thousands of archived pages, the developers use a single file to manage the visual presentation. The following line is included in the <head> section of every page:
<link rel="stylesheet" type="text/css" href="/assets/styles/main.css">
The site features an interactive archive viewer where users can see the date they accessed the specific record. This is handled by a script included in the page footer.
Part of the script in the file archive_utils.js is shown below:
function updateAccessStamp() { const stampElement = document.getElementById("access-timestamp"); const currentTime = new Date(); const formattedDate = "Record retrieved on: " + currentTime.toLocaleString(); if (stampElement !== null) { stampElement.textContent = formattedDate; }}
window.onload = updateAccessStamp;The administrators of MetroPulse want to ensure that their historical records are easily discoverable by researchers using global search engines. They also need to secure the subscriber login area where users manage their accounts.
Identify two benefits of using an external Cascading Style Sheet (CSS) file rather than defining styles internally within each individual HTML document.
Explain the processing that occurs within the client's web browser when the updateAccessStamp() function is executed.
Explain two ways in which the developers can use technical configuration files to assist search engine crawlers in indexing the MetroPulse archive effectively.
Distinguish between the GET and POST methods in the context of an HTTP request.
Explain how the implementation of HTTPS protects the data of users logging into the MetroPulse subscriber portal.
HTTPS is not a distinct protocol, but makes specific use of a combination of two separate protocols.
A web application provides a search form that allows a user to search a library database by author name. The user enters an author and submits the form in a web browser. The browser sends the form data to a web server, which runs a server-side script that queries a database and returns an HTML results page to the browser.
Identify these two protocols.
Outline their functions.
Outline the interaction between a user, a web browser and a domain name server when accessing sites on the internet.
Describe the processing that takes place when the form that was sent from the client is received by the web server.
Explain, giving two reasons, why the use of server-side scripting promotes security when retrieving content from databases.
A non-profit organization is launching an international educational portal named 'EduGlobal'. The portal provides interactive learning modules, a searchable database of academic papers, and a private forum for registered educators.
The portal is hosted on a central server and accessed via the URL: https://www.eduglobal-portal.org/resources/index.php.
To ensure high performance, the developers must decide which tasks are handled by the user's browser and which are handled by the server. They also need to ensure the site is easily discoverable by search engines while keeping sensitive data secure.
Identify two components of the URL https://www.eduglobal-portal.org/resources/index.php.
When a user signs up for the forum, a script checks if the password meets the minimum length requirements.
Outline one advantage of performing this check using client-side scripting rather than server-side scripting.
State the HTTP status code that the server would return to a browser if a student attempts to access a deleted lesson page.
The 'EduGlobal' team adds new research papers to the portal every week. Outline one way a web crawler (spider) identifies that new content has been added to the site's index.
The 'EduGlobal' portal must be accessible to students using various browsers (e.g., Chrome, Safari, Firefox) and different operating systems.
Explain the role of the World Wide Web Consortium (W3C) in making this possible.
The portal consists of a public blog and a private database of academic papers that requires a subscription to access.
Distinguish between the Surface Web and the Deep Web in the context of this portal, and explain why the academic papers might not appear in general search engine results.
A developer is building a web portal for an open-source documentation project. The portal needs to be highly accessible, performant, and easily indexed by search engines to ensure that users can find technical guides efficiently.
The developer decides to adhere strictly to the World Wide Web Consortium (W3C) standards for HTML and CSS.
Outline three reasons why adhering to these web standards is beneficial for a web project.
To manage how search engines interact with the portal, the developer includes both a robots.txt file and an XML sitemap.
Explain how these two files assist search engines in the indexing process.
The portal includes a registration form for new contributors. The developer must decide whether to use client-side scripting or server-side scripting for data validation.
Identify two benefits of performing validation on the client side and two benefits of performing it on the server side.
Search engines may use a ranking algorithm (e.g., PageRank) to estimate the importance of pages when ordering search results.
Explain how a page’s ranking can be influenced by links from other pages.