0% found this document useful (0 votes)
39 views

SyllabusMine

The document covers backend system design and development, focusing on key concepts such as the System Development Life Cycle (SDLC), various backend technologies, and the importance of security and performance in backend systems. It includes multiple-choice questions, true/false statements, matching exercises, and practical assessments related to system design and database management. Additionally, it discusses the development of a school management system and the use of UML diagrams in system design.

Uploaded by

gitwitayeho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

SyllabusMine

The document covers backend system design and development, focusing on key concepts such as the System Development Life Cycle (SDLC), various backend technologies, and the importance of security and performance in backend systems. It includes multiple-choice questions, true/false statements, matching exercises, and practical assessments related to system design and database management. Additionally, it discusses the development of a school management system and the use of UML diagrams in system design.

Uploaded by

gitwitayeho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 186

BACKEND SYSTEM DESIGN , DEVELOPMENT AND DATABASE

BACKEND,NODEJS ,MobileApp, Nosql, PHP

Backend System Design

Learning Outcome1

I. Multiple Choice Questions

1. Which of the following is NOT a phase in the System Development Life Cycle (SDLC)?
Answer: C) Abstraction
2. Which framework is commonly used with Python for backend development?
Answer: A) Django
3. What does FURPS stand for in requirements gathering?
Answer: A) Functionality, Usability, Reliability, Performance, Supportability
4. Which of the following is an example of a system analysis tool?
Answer: D) UML
5. Which of the following is a key component of system interaction?
Answer: B) Functionality requirements

II. True or False Questions

a) FURPS is an acronym used to describe the phases of the System Development Life Cycle (SDLC).
False

b) PHP is a backend development technology that has its own frameworks.


True

c) JSON is a data interchange format that is often used in APIs.


True

d) A Decision table is a system analysis tool used to represent and analyze complex decision-making scenarios.
True

e) The purpose of system interaction is to define the roles and functions of various components within a system.
True

III. Match Key Term with Corresponding Definition


No Key Term Definition
I) The part of a system that handles the logic, database interactions, and server-
1 Backend
side processing.
H) A concept that outlines the requirements for software, focusing on different
2 FURPS
quality attributes.
3 System K) An organized set of components working together to achieve a common goal.
D) The physical or virtual machine that provides services to other computers over
4 Server
a network.
5 Database A) A structured collection of data stored and accessed electronically.
B) A software environment that provides foundational services for other
6 Operating System
software.
System Development Life E) The process of planning, creating, testing, and deploying an information
7
Cycle system.
G) A software component that allows two applications to communicate with each
8 API
other.
9 JSON J) A data format often used in web APIs for transmitting structured data.
10 Framework C) A set of guidelines, libraries, and tools used to develop software applications.
11 UML F) A method of representing complex systems visually through diagrams.

IV. Open Questions

a) What does the "Technology Stack" mean in the report?


The technology stack refers to the combination of programming languages, frameworks, libraries, and tools used to
develop and run a software application.

b) How does the report look at backend security?


The report emphasizes backend security by discussing best practices like secure authentication, data encryption,
secure APIs, environment variable management, and vulnerability testing.

c) Why is it important to measure system performance?


It is important to measure system performance to ensure efficiency, scalability, user satisfaction, and to identify
bottlenecks that can affect application speed and reliability.

d) What problems can happen in managing backend systems?


Problems include server downtime, scalability issues, security breaches, database failures, and API malfunctions.

e) What are some examples of problems found in backend systems?


Examples include slow database queries, memory leaks, security vulnerabilities, broken APIs, and poor load
balancing.

f) Why is scalability important for a backend system?


Scalability is crucial because it ensures that the system can handle increased loads or growing numbers of users
without performance degradation.

g) What role does training the team play in backend system improvements?
Training ensures that developers are updated on the latest technologies, security practices, and performance
optimization techniques, which improves overall backend system reliability and performance.
Practical Assessment

FURPS Requirements Report for a School Management System (SMS)

Functionality

 Student Management: Enrollment, attendance tracking, grading.


 Teacher Management: Course assignment, schedules, grading input.
 Parent Portal: Communication with school, track student progress.
 Administrative Functions: Reports generation, system management.

Usability

 User-Friendly Interface: Simple navigation for staff, students, and parents.


 Responsive Design: Accessible across desktops, tablets, and smartphones.
 Help and Support: Integrated FAQs and support contacts.

Reliability

 Data Backup: Regular automatic backups.


 Error Handling: Clear messages and automatic recovery when errors occur.
 System Uptime: High availability with minimal downtime.

Performance

 Fast Load Time: Pages and reports load within 2 seconds.


 Scalability: System can support thousands of students without issues.
 Optimized Database Queries: For fast access and updates.

Supportability

 Documentation: Clear and updated technical and user manuals.


 Modular Codebase: For easier maintenance and updates.
 Version Control: Using Git for managing changes and collaboration.

END

Theoretical Assessment

1. Match the following terms with their definitions:

Answer Term Definition


…….. A) Data Flow Diagram 4) A diagram representing data flow within a system
……. B) Class Diagram 3) A diagram showing the static structure of a system
….. C) Sequence Diagram 2) A diagram depicting object interactions over time
……. D) Activity Diagram 1) A diagram representing a sequence of operations

2. Match the following UML diagrams with their purpose:


Answer UML Diagram Purpose
…….. A) State Machine Diagram 2) Shows dynamic behavior using state transitions
…..… B) Use Case Diagram 3) Shows high-level system functionality with actors
…..… C) Communication Diagram 1) Represents system interactions and message exchange
…… D) Component Diagram 4) Describes the physical components of a system

1. Matching Terms with Definitions


Answer Term Definition

4 A) Data Flow Diagram A diagram representing data flow within a system

3 B) Class Diagram A diagram showing the static structure of a system

2 C) Sequence Diagram A diagram depicting object interactions over time

1 D) Activity Diagram A diagram representing a sequence of operations

2. Matching UML Diagrams with Their Purpose


Answer UML Diagram Purpose

2 A) State Machine Diagram Shows dynamic behavior using state transitions

3 B) Use Case Diagram Shows high-level system functionality with actors

1 C) Communication Diagram Represents system interactions and message exchange

4 D) Component Diagram Describes the physical components of a system

3. Evaluate the following statements as True or False:

a) A sequence diagram shows the interactions between objects in terms of the messages exchanged over time.
True

b) An activity diagram portrays the static structure of the system by showing its classes and methods.
False

c) A use case diagram encapsulates the functional requirements of a system by utilizing actors and use cases.
True

d) The composite structure diagram displays the relationships between the parts within a class, focusing on its
internal structure.
True

e) A package diagram is used to describe the dynamic behavior of a system and how objects interact over time.
False
4. What are the main advantages and disadvantages of using UML diagrams in system design?

Advantages:

 Provide clear visual representation of the system.


 Enhance communication among stakeholders.
 Help identify problems early in the development process.
 Support documentation and maintenance.

Disadvantages:

 Time-consuming to create and maintain.


 Requires training to interpret and create correctly.
 May oversimplify complex systems if not detailed properly.

Practical Assessment

Imagine you are a software system designer for a student-owned project. Each student should manage their own
project tasks and progress.

1. Use Case Diagram:

 Primary Actors: Students, Project Mentors, System Administrators


 Use Cases: Add Task, Update Task, Track Progress, Assign Mentor, View Reports.

2. Class Diagram:

 Classes:
o Student (Attributes: studentId, name; Methods: addTask(), updateProgress())
o Task (Attributes: taskId, description, deadline, status; Methods: updateStatus())
o Project (Attributes: projectId, title, description)
o Mentor (Attributes: mentorId, name)
 Relationships:
o Student "works on" Task
o Mentor "guides" Student
o Student "owns" Project

3. Algorithm to Manage Project Tasks:

pgsql
CopyEdit
Start
Login Student
Display Task List
If (new task) then
Add Task (description, deadline)
Else
Select Task
Update Task (status)
EndIf
Track Progress
Logout
End

4. Flowchart:
(I can generate an actual flowchart image if you want.)
5. Level 0 Data Flow Diagram (DFD):

 External Entities: Student, Mentor


 Processes: Manage Tasks, Track Progress
 Data Stores: Task Details, Student Progress

6. Entity-Relationship Diagram (ERD):

 Entities: Student, Task, Project, Mentor


 Attributes: IDs, names, descriptions, deadlines, statuses
 Relationships:
o Student —(works on)—> Task
o Mentor —(guides)—> Student
o Student —(owns)—> Project

Explanation:
The DFD focuses on how data flows during operations (like updates and tracking), while the ERD focuses on how
data is stored in relation to entities.

7. Decision Table for Task Prioritization:

Conditions Task Urgency Student Workload Deadline Near? Action


1 High Low Yes Prioritize Immediately
2 Medium High No Schedule Later
3 High High Yes Prioritize and Alert Mentor
4 Low Low No Regular Scheduling

Decision Tree:
Start → Task Urgency? → Workload? → Deadline Near? → Action

Discussion:
The decision table organizes possible actions based on different conditions, while the decision tree provides a clear
flow for quick decision-making during task prioritization.

Written Assessment

I. Multiple Choice Questions

1. What is the purpose of a Data Flow Diagram (DFD)?


Answer: B) To represent the flow of data within a system
2. Which of the following is NOT an element of a Data Flow Diagram (DFD)?
Answer: D) Network
3. What is the main difference between Level 0 and Level 1 DFD?
Answer: C) Level 0 DFD is the context diagram, while Level 1 DFD breaks down processes into more
detail
4. Which software tool is commonly used for creating Data Flow Diagrams?
Answer: C) Visual Paradigm
5. In the context of database design, what is a 'relationship'?
Answer: A) A link between two tables that defines how data in one table relates to data in another
6. Which document details the functionality of a system?
Answer: B) Functional Specification Document (FSD)

II. True or False Questions

1. A Data Flow Diagram (DFD) is used to represent the flow of data within a system.
True
2. Level 2 DFD is typically the highest level, providing a very broad overview of the system.
False (Level 0 is the highest/most general; Level 2 is more detailed.)
3. Microsoft Office is a preferred tool for creating Data Flow Diagrams.
False (Specialized tools like Visual Paradigm are preferred.)
4. In database design, identifying database objects includes defining tables and their relationships.
True
5. System Design Document (SDD) primarily focuses on the technical aspects of system implementation.
True
6. Use Case Documents are a type of system design documentation.
True
7. The Physical Data Model represents the logical structure of the database.
False (It represents the actual physical implementation, not just logical.)
8. Technical Specification Document (TSD) includes detailed information about the system’s hardware
requirements.
True

Practical Assessment

Development of XYZ School Management System (Rubavu, Rwanda)

You are hired to develop the following for the school management system:

1. Data Flow Diagram (DFD)

Context Diagram (Level 0 DFD)

 Shows the entire school system as a single process interacting with:


o Students
o Teachers
o Parents
o Admin Staff

Level 1 DFD
 Breakdown of major processes:
o Student Enrollment: Handles admissions.
o Attendance Management: Records daily attendance.
o Grading Management: Manages exam scores and reports.
o Communication Management: Allows parents and teachers to communicate.
o Administration Management: Oversees scheduling and reporting.

2. Physical Data Model

 Tables:
o Students (StudentID, FirstName, LastName, DateOfBirth, Class,
ParentID)
o Teachers (TeacherID, Name, Department, Email)
o Parents (ParentID, Name, ContactInfo)
o Courses (CourseID, CourseName, TeacherID)
o Grades (GradeID, StudentID, CourseID, Grade)
o Attendance (AttendanceID, StudentID, Date, Status)
 Relationships:
o A Student belongs to one Parent.
o A Teacher teaches many Courses.
o A Student has many Grades and many Attendance records.

3. Identification and Design of Database Objects

 Primary Keys: Each table has a unique primary key (e.g., StudentID, TeacherID).
 Foreign Keys:
o Grades.StudentID → Students.StudentID
o Grades.CourseID → Courses.CourseID
o Courses.TeacherID → Teachers.TeacherID
o Students.ParentID → Parents.ParentID
 Indexes:
o On StudentID, TeacherID, and CourseID for faster lookup.

4. System Design Documentation

 Functional Specification Document (FSD):


o Describes user functionality: enrollment, attendance tracking, grading, communication.
 System Design Document (SDD):
o Technical architecture, data models, DFDs, database design.
 Technical Specification Document (TSD):
o Hardware and software requirements, including server specs, network configurations.
 Use Case Documents:
o Use cases for student enrollment, grade submission, report generation, messaging between parents
and teachers.
END

Nodejs (Backend Application)

Backend Application Development - Learning Outcome 1 End Assessment, properly structured with each
question aligned with its correct answer.

I: True or False Questions

1. The POST HTTP method is typically used to retrieve data from a server. ❌ False ➝ The POST
method creates new resources; GET retrieves data.
2. Middleware in Express.js can be used to modify the request and response objects. ✅ True ➝
Middleware processes requests before passing them to route handlers.
3. A 404 Not Found status code indicates that the requested resource was successfully created. ❌ False
➝ 404 means the resource does not exist.
4. In Express.js, the next() function is used to pass control to the next middleware function in the stack.
✅ True
5. Debugging a RESTful API involves reviewing and updating the API documentation as one of the
steps. ✅ True
6. CRUD operations in Node.js using Express.js include creating, reading, updating, and deleting
resources. ✅ True

II: Complete the Sentence

7. To define endpoints in an Express.js application, you must first ✅ install Express.js


8. The HTTP status code ✅ 500 is used when a server-side error occurs, such as a database query
failing.
9. In Node.js, the ✅ input validation middleware checks if the data in the request meets necessary
requirements.
10. When testing API endpoints with Postman, you should first select the ✅ HTTP method
11. A ✅ middleware is a tool in Express.js used to perform tasks like logging, input validation, and error
handling during the request-response cycle.
12. The 201 Created status code is used when ✅ a resource is successfully created.

III: Multiple Choice Questions

13. Requirements for developing a backend application, EXCEPT: ✅ d) Install MS Word

IV: Postman - True/False

14. Postman is a popular tool for testing and documenting APIs. ✅ True
15. Nodemon is a utility tool for Node.js that helps developers during development. ✅ True
16. Node.js is an open-source JavaScript runtime environment that allows developers to execute
algorithm code on the server side. ✅ True
17. Postman is a popular tool for developing and documenting APIs. ✅ True
V: Short Answers

18. What will be performed once you use the following command: ✅ mkdir ubudeheproject → Creates a
new folder named "ubudeheproject"

VI: Expand the Acronyms

19.

 API: ✅ Application Programming Interface


 REST: ✅ Representational State Transfer
 NPM: ✅ Node Package Manager
 DBMS: ✅ Database Management System

VII: True/False

20. Dependencies are internal packages or libraries that a Node.js application relies on to perform
various tasks. ✅ True

VIII: Short Command Answers

21. Command to install Express: ✅ npm install express


22. Command to install Nodemon globally: ✅ npm install -g nodemon
23. Command to initialize a Node.js project: ✅ B) npm init -y
24. Package to parse request bodies in Express: ✅ B) body-parser
25. HTTP method to retrieve data: ✅ C) GET
26. Status code for successful creation: ✅ D) 201
27. Middleware for logging details: ✅ C) Logging Middleware
28. Method to delete a resource: ✅ B) DELETE
29. Command to install Express: ✅ A) npm install express
30. Purpose of Error Handling Middleware: ✅ C) To handle errors and send appropriate responses
31. HTTP status code for resource not found: ✅ C) 404
32. Default port number for Express server: ✅ B) 3000

IX: Matching Questions


Match HTTP Methods
Method Usage

A) GET ✅ Retrieve data

B) POST ✅ Create new resource

C) PUT ✅ Update data

D) DELETE ✅ Delete data


Match Middleware Functions
Middleware Function

A) Logging Middleware ✅ Logs details of requests

B) Input Validation Middleware ✅ Validates incoming data

C) Error Handling Middleware ✅ Catches errors and sends responses

X: Fill in the Blanks with Keywords

35. To create a new resource, you typically use the ✅ POST HTTP method.
36. In Express.js, middleware functions can modify the request and response objects, ✅ end the request-
response cycle, and call the next middleware function.
37. Command to install MySQL package in Node.js: ✅ npm install mysql
38. When a server encounters an unexpected issue, it typically responds with ✅ 500 Internal Server
Error
39. To test API endpoints, you can use a tool called ✅ Postman
40. Middleware responsible for logging details of incoming requests: ✅ Logging
41. A resource that does not exist in the database should return ✅ 404 Not Found status code.
42. The status code ✅ 200 OK indicates a request was successful and data is returned.
43. Middleware that handles errors in an Express app: ✅ Error Handling
44. CRUD operations in Node.js require setting up Express endpoints for ✅ Create, Read, Update, and
Delete
45. Method used to update a resource: ✅ PUT
46. An Express server can be started by calling the ✅ listen method.
47. Input validation middleware ensures incoming data ✅ meets necessary requirements.
48. Successful resource creation in a RESTful API returns ✅ 201 Created status code.
49. To connect to MySQL in Node.js, create a ✅ MySQL Connection
50. The ✅ GET method is used to request data from a specified resource.
51. Middleware to parse JSON data in incoming requests: ✅ body-parser
52. When debugging a RESTful API, it is important to ✅ validate input data and monitor network
traffic.

XI: Practical Assessment - API & Database Development for Tela Tech Ltd
Database: Kigali Innovation DB

✅ Table: clients

Column Data Type

ID INT PRIMARY KEY

Names VARCHAR(255)

Sex VARCHAR(10)

Address VARCHAR(255)
Column Data Type

Phone VARCHAR(15)

Email VARCHAR(255)

API Endpoints

✅ Insert client

http

POST /clients
Status Code: 201 Created

✅ Update client

http

PUT /clients/:id
Status Code: 200 OK

✅ Retrieve clients

http

GET /clients
Status Code: 200 OK

✅ Delete client

http

DELETE /clients/:id
Status Code: 200 OK
Error Handling

✅ 404 Not Found → Resource does not exist ✅ 500 Internal Server Error → Server issues

🚀 Outcome: Tela Tech Ltd now has a structured API connected to its database!

: Multiple Choice Questions

1. Which type of encryption uses the same key for both encryption and decryption? ✅ A) Symmetric
Encryption
2. Which algorithm is commonly used for symmetric encryption in Node.js?? ✅ B) AES
3. In asymmetric encryption, which key is used to decrypt the data? ✅ B) Private Key
4. Which Node.js module provides built-in support for cryptographic operations? ✅ C) crypto
5. Which of the following is NOT a use case for hashing? ✅ B) Encrypting large amounts of data
6. What is the output size of a SHA-256 hash? ✅ B) 256 bits
7. Which of the following is a disadvantage of symmetric encryption? ✅ B) Key distribution
8. What does the bcrypt library primarily do? ✅ B) Hash passwords
9. Which encryption method is generally slower? ✅ B) Asymmetric
10. In the context of encryption, what does IV stand for? ✅ A) Initialization Vector

II: True or False Questions

1. Asymmetric encryption uses the same key for both encryption and decryption. ❌ False
2. The Moment.js library in Node.js is primarily used for date manipulation. ✅ True
3. The crypto module in Node.js supports both symmetric and asymmetric encryption techniques. ✅
True
4. Using bcrypt in Node.js automatically handles the addition of salt to the hashing process. ✅ True
5. The package.json file in a Node.js project keeps track of dependencies and their versions. ✅ True
6. Hash functions are reversible. ❌ False
7. Asymmetric encryption is more suitable for bulk data encryption than symmetric encryption. ❌
False
8. A public key can be shared openly while the private key must be kept secret. ✅ True
9. All cryptographic algorithms are equally secure. ❌ False
10. Hashing can be used to securely store passwords. ✅ True

III: Fill in the Blank Questions

1. Symmetric encryption is typically used for encrypting large amounts of data ✅ A) quickly
2. The ✅ B) crypto module in Node.js supports various cryptographic functions.
3. In ✅ B) asymmetric encryption, a pair of keys (public and private) is used, with one key encrypting
the data and the other decrypting it.
4. The bcrypt library is commonly used in Node.js for securely ✅ A) hashing passwords
5. A ✅ A) 128 -bit key and a 16-byte initialization vector (IV) are generated for AES encryption.
6. Salting is often used to prevent brute-force attacks on hashed passwords. ✅ A) Salting
7. Symmetric encryption is more efficient for encrypting large amounts of data. ✅ A) Symmetric
8. The RSA algorithm is commonly used in asymmetric encryption to generate public and private keys.
✅ B) RSA
9. To store passwords securely, we use hashing, not encryption. ✅ B) Hashing
10. The process of converting plaintext into ciphertext is known as encryption. ✅ C) Encryption

IV: Matching Encryption Type with Description


Encryption Type Description

A) Symmetric Uses the same key for encryption and decryption ✅

B) Asymmetric Uses a pair of keys (public and private) ✅

C) Hashing Produces a fixed-size output from input data ✅

D) Encryption Converts plaintext into ciphertext ✅

V: Additional Multiple-Choice Questions

1. Which of the following is a secure hash function? ✅ C) SHA-256


2. What is the purpose of salt in hashing? ✅ B) To add randomness
3. Which is an example of a one-way hash function? ✅ C) SHA-512
4. What type of attack does salting help prevent? ✅ C) Rainbow table attacks
5. Which cryptographic operation is reversible? ✅ B) Encryption
6. What is the main purpose of the initialization vector (IV)? ✅ B) To ensure randomness
7. Which of the following is an example of a symmetric encryption algorithm? ✅ B) AES
8. What does SSL stand for? ✅ A) Secure Socket Layer
9. Which of the following is NOT a feature of hashing? ✅ C) Reversible
10. Which Node.js function is used to create a hash? ✅ B) crypto.createHash

Practical Assessment: Implementing Encryption & Security in Node.js

Scenario: Tela Tech Ltd requires secure encryption methods for web applications.

✅ Install Required Node.js Libraries

bash

npm install crypto bcrypt jsonwebtoken dotenv

✅ Implement Symmetric Encryption Using AES

javascript

const crypto = require("crypto");

const key = crypto.randomBytes(32);


const iv = crypto.randomBytes(16);

function encryptData(data) {
const cipher = crypto.createCipheriv("aes-256-cbc", key, iv);
let encrypted = cipher.update(data, "utf-8", "hex");
encrypted += cipher.final("hex");
return encrypted;
}

console.log("Encrypted Data:", encryptData("Tela Tech Confidential"));

✅ Implement Asymmetric Encryption Using RSA

javascript

const { generateKeyPairSync, publicEncrypt, privateDecrypt } =


require("crypto");

// Generate RSA Key Pair


const { publicKey, privateKey } = generateKeyPairSync("rsa", {
modulusLength: 2048,
});

function encryptMessage(message) {
return publicEncrypt(publicKey, Buffer.from(message)).toString("hex");
}
function decryptMessage(encryptedMessage) {
return privateDecrypt(privateKey, Buffer.from(encryptedMessage,
"hex")).toString();
}

const encryptedMsg = encryptMessage("Sensitive Data");


console.log("Encrypted:", encryptedMsg);
console.log("Decrypted:", decryptMessage(encryptedMsg));

✅ Secure Password Hashing with Bcrypt

javascript

const bcrypt = require("bcrypt");

async function hashPassword(password) {


const salt = await bcrypt.genSalt(10);
return await bcrypt.hash(password, salt);
}

hashPassword("SecurePassword123").then((hashed) => console.log("Hashed


Password:", hashed));

✅ Secure API Authentication Using JWT

javascript

const jwt = require("jsonwebtoken");


const SECRET_KEY = "super_secure_key";

const token = jwt.sign({ userId: 123 }, SECRET_KEY, { expiresIn: "1h" });


console.log("JWT Token:", token);

🚀 Outcome: Tela Tech Ltd now has a secure Node.js backend with encryption, password security, and API
protection!

I: Multiple Choice Questions

1. What is the primary purpose of unit testing? ✅ b) To validate individual components or functions ➝
Unit testing ensures that each function works correctly in isolation.
2. Which of the following is a popular unit testing framework for Node.js?? ✅ d) Mocha ➝ Mocha is
one of the most widely used testing frameworks for Node.js..
3. Which assertion library is commonly used with Mocha? ✅ b) Chai ➝ Chai provides assertion styles
for Mocha testing.
4. What command is used to install Mocha in a Node.js project? ✅ a) npm install mocha
5. In Chai, which API is used for behavior-driven development (BDD) style assertions? ✅ a) Should
6. What is the main benefit of using the Expect API in Chai? ✅ a) It is simpler to write and understand
7. What is the first step in the unit testing process? ✅ b) Writing the test cases
8. Which tool is commonly used for usability testing? ✅ b) Puppeteer
9. What does the acronym OWASP stand for? ✅ a) Open Web Application Security Project
10. Which of the following is NOT a type of security vulnerability? ✅ c) Unit Testing
11. Which command installs the Chai assertion library? ✅ a) npm install chai
12. What type of testing is Postman primarily used for? ✅ b) API Testing
13. What is the primary function of Puppeteer? ✅ a) Simulate user interactions in web applications
14. In Mocha, which hook runs before all test cases? ✅ a) before()
15. Which is NOT a key benefit of unit testing? ✅ d) Improved network performance
16. What is the purpose of the describe() function in Mocha? ✅ a) To group related test cases
17. Which of the following is a feature of the Chai Expect API? ✅ a) It allows chaining of assertions
18. Which method is used to run tests in Mocha? ✅ b) npm test
19. What is an example of a dynamic analysis tool for security testing in Node.js?? ✅ a) OWASP ZAP
20. Which framework is commonly used to implement security tests in Node.js?? ✅ d) Cypress
21. What is a key benefit of using automated testing tools like Puppeteer? ✅ a) Reduces human error
22. Which command is used to run a collection in Postman? ✅ b) newman run
23. In Mocha, how do you skip a test case? ✅ b) Use it.skip()
24. Which of the following is an example of a static analysis tool? ✅ a) ESLint
25. What is a common use case for Chai’s should API? ✅ a) Writing test assertions in a more natural
language style

II: Matching Statements


Unit Testing Tools with Their Primary Language Support
Tool Primary Language

a) Mocha ✅ 1. JavaScript

b) Junit ✅ 3. Java

c) PyTest ✅ 2. Python

d) RSpec ✅ 4. Ruby

Security Testing Tools and Their Function


Tool Function

a) OWASP ZAP ✅ 2. Dynamic application security testing

b) ESLint ✅ 1. Static code analysis

c) Burp Suite ✅ 3. Automated web vulnerability scanner

d) SonarQube ✅ 4. Code quality analysis

Puppeteer Functions and Their Description


Function Description

a) page.goto() ✅ 3. Navigates to a URL

b) page.click() ✅ 1. Simulates a browser click


Function Description

c) page.screenshot() ✅ 2. Takes a screenshot of the page

d) page.type() ✅ 4. Enters text into an input field

III: Fill in the Blanks

1. Unit testing is primarily conducted to ensure that ✅ individual components or functions work as
expected.
2. In Chai, the ✅ Expect API allows for natural language assertions.
3. The Mocha testing framework uses the ✅ describe() method to group related tests.
4. Usability testing is important because it helps identify issues with ✅ user experience and interface
design.
5. A common vulnerability in web applications, where an attacker can inject SQL queries, is known as
✅ SQL Injection.
6. Postman is commonly used to ✅ test API endpoints and automate testing.
7. Puppeteer allows developers to ✅ automate user interactions in a headless Chrome browser.
8. In security testing, ✅ penetration testing is used to identify potential vulnerabilities before an
attacker can exploit them.
9. Node.js applications should always use ✅ SSL/TLS encryption to ensure data is transmitted
securely.
10. A test case in unit testing is designed to ✅ validate a specific function or feature.

IV: Practical Assessment - API & Security Testing for TelaTech Ltd
Database: Kigali Innovation DB

✅ Table: clients

Column Data Type

ID INT PRIMARY KEY

Names VARCHAR(255)

Sex VARCHAR(10)

Address VARCHAR(255)

Phone VARCHAR(15)

Email VARCHAR(255)

API Endpoints

✅ Insert client

http

POST /clients
Status Code: 201 Created

✅ Update client

http

PUT /clients/:id
Status Code: 200 OK

✅ Retrieve clients

http

GET /clients
Status Code: 200 OK

✅ Delete client

http

DELETE /clients/:id
Status Code: 200 OK
Error Handling

✅ 404 Not Found → Resource does not exist ✅ 500 Internal Server Error → Server issues

Testing Tasks

1️Use Postman for usability testing on APIs 2️⃣ Use Puppeteer for frontend automation testing 3️⃣ Use Mocha
& Chai for unit testing of endpoints 4️⃣ Monitor test results for API performance 5️⃣ Implement security
testing in Node.js 6️⃣ Perform penetration testing using OWASP ZAP

🚀 Outcome: TelaTech Ltd now has well-tested APIs, with usability validation and security enhancements
implemented!

Application of Learning 4.4

STU LTD Node.js Backend Developer and Deployment Assessment

Written Assessment

I. Multiple Choice Questions

1. What is the primary purpose of Node.js application deployment?


o Answer: c) Preparing, transferring, and running a Node.js application on a server or cloud
environment
2. Which of the following tools is commonly used for containerizing a Node.js application?
o Answer: b) Docker
3. Which command is used to start a Node.js application if index.js is the entry point?
o Answer: d) node index.js
4. Which of the following is NOT a type of Node.js application deployment?
o Answer: d) Script-based Deployment
5. Which process manager is commonly used to manage Node.js applications in production?
o Answer: b) PM2

II. Complete the Statement

1. In a CI/CD pipeline, tools like _____________ are used to automate the testing and deployment
process.
o Answer: a) Jenkins
2. To manage environment variables and sensitive information like API keys in a Node.js application,
you should use _____________.
o Answer: c) Environment Variables
3. Before deploying a Node.js application, it is essential to install all necessary modules using
_____________.
o Answer: b) npm install
4. The command pm2 start index.js is used to _____________ the application using PM2.
o Answer: c) Start
5. For secure file transfer to a server, tools like _____________ can be used.
o Answer: b) SCP

III. Matching Questions

1. Deployment Type and Description:

Answer Deployment Type Description


3 A) Manual Deployment 3) Manually transferring and starting the application
1 B) Continuous Deployment 1) Automated process with CI/CD pipelines
2 C) Docker-based Deployment 2) Containerizing the application using Docker

2. Tool and Function:

Answer Tool Function


3 A) Webserver 3) Serves the application and handles incoming traffic
1 B) Database 1) Stores and retrieves application data
2 C) NodeJS Runtime 2) Executes JavaScript code on the server

IV. True or False

1. Node.js is a runtime environment that allows you to run JavaScript on the server side.
o Answer: True
2. Continuous deployment means that every change that passes the automated tests is deployed to
production automatically.
o Answer: True
3. Docker is a version control system used for managing Node.js application code.
o Answer: False
4. PM2 is used for managing and monitoring Node.js applications in production.
o Answer: True
5. SCP is used to manage Node.js dependencies and packages.
o Answer: False
6. In a CI/CD pipeline, Jenkins can be used to automate the deployment of a Node.js application.
o Answer: True
7. Environment variables are used to store sensitive information, such as API keys, in a Node.js
application.
o Answer: True
8. A webserver is responsible for storing and retrieving data in a Node.js application.
o Answer: False

Practical Assessment

Scenario: TelaTech Ltd Node.js Deployment Task

Deployment Environment Setup:

 Operating System: Windows Server


 Node.js Runtime: Install Node.js from the official website
 Package Manager: npm (comes bundled with Node.js)
 Webserver: Install and configure Nginx or Apache
 Database: Install and configure MongoDB or MySQL

Manual Deployment of Node.js Application:

1. Copy the Node.js application source code to the server.


2. Open Command Prompt, navigate to the project directory.
3. Install dependencies:
4. npm install
5. Start the application:
6. node index.js

or using PM2:

pm2 start index.js

Maintenance Plan:

 Identify maintenance requirements: Log errors, monitor updates.


 Schedule regular updates: Monthly dependency updates and security patches.
 Automate maintenance tasks: Use CI/CD pipelines for deployment and testing.
 Monitor application performance: Use tools like PM2 monitoring, New Relic, etc.
 Test regularly: Unit tests, integration tests, and load tests.
 Disaster recovery plan: Regular database backups, server snapshots.
 Document changes: Maintain a changelog file and update technical documentation.

Continuous Maintenance and Improvement:

 Upgrade Node.js dependencies.


 Secure both old and new functionalities.
 Develop new features and test thoroughly.
 Deploy using CI/CD pipelines to production.

Applying NodeJS Documentation Tools and Frameworks:

 Swagger: Use Swagger/OpenAPI to document APIs.


 Postman: Export Postman collections for API usage.
 Documentation Generators: Use JSDoc to generate documentation from code comments.
 Collaborative Documentation:
o Push documentation to GitHub.
o Enable pull requests for documentation updates.

END

Mobile App

Mobile App

Learning outcome 1

Theoretical Assessment – Dart Programming

I. Choose the correct answer

1. What type of programming paradigm does Dart primarily support?


o B) Object-oriented programming
2. Which of the following features is NOT a characteristic of Dart?
o D) Lack of null safety
3. Which framework is commonly used with Dart for building web applications?
o A) Angular
4. Dart is primarily used for which of the following applications?
o C) Web and mobile applications
5. Which feature of Dart enhances its performance for mobile applications?
o B) Hot reload
6. What is the primary framework for building cross-platform mobile applications using Dart?
o B) Flutter

II. True/False Statements

1. Dart supports both static and dynamic data types, allowing for flexibility in variable declaration.
o True
2. In Dart, variables must be declared with a type before they can be used.
o False (Type inference is allowed using var or dynamic.)
3. Dart provides standard control flow structures like if, else, for, and switch.
o True
4. In Dart, functions are first-class citizens, meaning they can be assigned to variables and passed as
arguments.
o True
5. Dart can only be used for developing web applications and is not suitable for native app development.
o False
III. Fill in the blanks using the correct term (Class, Encapsulation, Polymorphism, Inheritance, Abstraction,
Object)

A) In Dart, a blueprint for creating objects is called a Class.


B) Inheritance allows a class to inherit properties and methods from another class, promoting code reusability.
C) Polymorphism is the ability of different classes to be treated as instances of the same class through a common
interface.
D) Encapsulation is a principle that restricts access to certain components of an object, allowing only controlled
access through methods.
E) Abstraction is the concept of hiding complex implementation details and exposing only the necessary features of
an object.

IV. Match the terms to their description

Answer Term Description


C 1) Using built-in functions Utilizing functions provided by Dart's libraries.
A 2) Declaring functions Defining a function with specific inputs and outputs.
D 3) Parameters and return types Specifying the types of inputs and outputs in a function.
B 4) Calling functions The act of executing a function's code.

Practical Assessment – Dart Mobile Development

Client: SmartHome Innovations

Project Objective:
Develop a cross-platform mobile application for smart home control using Dart and Flutter.

Requirements:

 Tool Setup:
o Install Flutter SDK and Dart.
o Configure Android Studio or VS Code.
o Set up an emulator or physical device.
 Dart Concepts and OOP:
o Use Dart variables, data types, functions, and control flow.
o Apply OOP principles (encapsulation, inheritance, polymorphism, abstraction).
 App Features:
o Device on/off toggles.
o Real-time monitoring dashboard.
o Room-specific control widgets (e.g., temperature, lights).
 Library & Package Usage:
o Use http for API calls.
o Use provider or riverpod for state management.
o Use flutter_switch or fluttertoast for UI enhancements.

Deliverables:

 Functional smart home mobile app.


 Clean and commented source code.
 Screenshot-based usage manual.
 Deployment instructions for Android/iOS.

LEARNING OUTCOME 2

Theoretical Assessment – Flutter

I. Fill in the blanks using the correct word

(widget, build, natively compiled, Navigator, flutter doctor, core widget)

A. Flutter is an open-source UI software development kit (SDK) created by Google. Its primary purpose is to allow
developers to build natively compiled applications for mobile, web, and desktop from a single codebase.
B. A widget in Flutter is the basic building block of the Flutter UI. Everything in Flutter is a widget, including
layout structures, elements, and animations.
C. The lifecycle of a Stateful widget includes methods such as createState, initState, and build.
D. To check if everything is properly installed after setting up the Flutter SDK, you run the command: flutter
doctor.
E. The Navigator widget is used to navigate between different screens in Flutter.

II. Multiple Choice (Circle the correct answer)

1. Which of the following are features of Flutter?


o d) All the above
2. What type of widget would you use if the UI needs to change dynamically based on user interaction?
o b) Stateful Widget
3. Which state management package is commonly used with Flutter?
o d) All of the above
4. Which widget would you use to display text with specific styling in Flutter?
o d) All of the above
5. What is the primary difference between Material Design and Cupertino widgets?
o b) Material Design follows Android guidelines, Cupertino follows iOS guidelines

III. Match the terms to their description

Answer Term Description


1–A Flutter A) The act of executing a function's code. (Generic; in context: "running code")
2–C Widget C) The primary UI building block in Flutter.
3–B GetX B) A state management package that simplifies state management.
4–D Navigator D) The widget used to navigate between different screens.
5–E BLoC Pattern E) A pattern used for managing complex state in Flutter.

Practical Assessment – Flutter App Development


Client: TaskMaster Inc.

Project Objective:
Develop a basic task management app using Flutter.

App Requirements:

 Tool Setup:
o Install Flutter SDK.
o Set up development IDE (Android Studio or VS Code).
o Create and run a new Flutter project.
 Core Features:
o Add new tasks.
o View task list.
o Mark tasks as complete/incomplete.
o Delete tasks.
 Widget Usage:
o Use TextField, ListView, Checkbox, ElevatedButton, and Card widgets.
o Apply layout widgets like Column, Row, Padding, Expanded.
 State Management:
o Use setState() for basic local state.
o Optional: Implement Provider for global state.
 UI Enhancements:
o Use pre-designed widgets (ListTile, AppBar, FloatingActionButton).
o Add basic animations and responsiveness.

Deliverables:

 Fully working task management app.


 Clean, commented source code.
 Screenshots of core functionality.
 Instructions to run the app.

LEARING OUTCOME 3

📘 Theoretical Assessment

I. Multiple Choice – Circle the Correct Answer

1. Which HTTP method is primarily used to create a new resource on the server?
✅ B) POST
2. What is the primary purpose of the PUT method in RESTful APIs?
✅ B) Update an existing resource
3. Which of the following is essential for securely handling user authentication in a mobile application?
✅ C) Utilizing HTTPS for API calls
4. What is the purpose of the PATCH method in RESTful services?
✅ B) Update part of a resource
II. True or False – Answer the following statements

1. Data integrity refers to the protection of data from unauthorized access and modifications
✅ False
(Data integrity is about accuracy and consistency. Unauthorized access relates to security.)
2. Using encryption is a common practice to enhance security standards for data stored in a database
✅ True
3. Regular audits and monitoring are not necessary for maintaining data integrity in a backend system
✅ False
4. Security standards such as GDPR and HIPAA help organizations ensure the confidentiality and
integrity of sensitive data
✅ True
5. Implementing strong access control measures can help maintain both data integrity and security in a
backend application
✅ True

III. Fill in the blanks (Choose from: Logging, Breakpoints, Codebase, Assertion, Debug, Isolation)

1. In software development, a codebase is the collection of source code used to build a software program.
2. The process of identifying and fixing bugs in your application is known as debug.
3. Logging is the practice of recording information about the execution of a program to help diagnose issues.
4. In testing, isolation refers to the practice of running tests in a way that ensures they do not affect each
other.
5. A(n) assertion is a statement used in programming that checks if a condition is true, often used in testing.
6. Developers use breakpoints to pause the execution of a program at a specific line of code to examine the
state of the application.

IV. Match the following terms to their descriptions

Answer Term Description


1 – C Unit Tests C) Tests individual components or functions in isolation.
2 – E Widget Tests E) Tests the user interface for usability and visual correctness
Integration
3–B B) Tests the interaction between different modules of the application.
Tests
Functional
4–D D) Tests the application against functional requirements.
Tests
F) Ensures that previously developed and tested software still works after a change.
5–F UI Tests
(Typically this fits "Regression Tests" but we'll keep this for UI if needed to match list.)
Performance
6–A A) Tests the performance and responsiveness of the application.
Tests

🛠 Practical Assessment

Company: TechSolutions Inc

Objective:
Build a mobile application that uses backend integration for managing user data and improving user experience.
The app must implement full HTTP support, debugging, testing, and follow microapp architecture for scalability.

✅ Requirements:

1. HTTP Request Handling:


o Use the following methods:
 POST: Create user data
 GET: Retrieve user data
 PUT: Update entire user data
 DELETE: Remove user data
 PATCH: Update part of user data
o Use tools like http or Dio in Flutter for API interaction
2. Architecture:
o Implement Microapps Architecture:
 Split the app into modular features
 Each microapp should handle its own logic and UI
 Easier to scale and test
3. Codebase Debugging & Error Handling:
o Use debugging tools like breakpoints and logs
o Add try-catch for network requests and show user-friendly error messages
o Record errors using logging libraries (logger, sentry, etc.)
4. Testing:
o Write unit tests for services and data processing
o Include widget tests for UI components
o Ensure test isolation using mocking tools (e.g., mockito)
o Validate API integration with mock responses or test servers

📂 Deliverables:

 Complete Flutter project with backend API integration


 Source code with comments and documentation
 Screenshots or video showing:
o HTTP operations (CRUD + PATCH)
o Debugging examples
o Test coverage report (or test results)
 README with setup instructions

LEARING OUTCOME 4

I. Multiple Choice Questions with Answers

1. Which file format is used for iOS app packages?


o A) APK
o B) IPA ✅
o C) AAB
o D) JAR
✅ IPA is the file format used for iOS app packages.
2. What does Hot Restart do in mobile development?
o A) Restarts the app without losing the current state ✅
o B) Compiles code at runtime
o C) Displays real-time changes without a full restart
o D) Generates a new app bundle
✅ Hot Restart restarts the app and reinitializes app state but retains code changes.
3. In the app submission process, which of the following is NOT a required asset?
o A) App Icon
o B) App Screenshots
o C) User Manual ✅
o D) App Promotional Materials
✅ User manuals are not typically required for app store submissions.
4. Which Google tool is used for app distribution?
o A) Google Drive
o B) Google Play Console ✅
o C) Google Forms
o D) Google Analytics
✅ Google Play Console is used to publish and manage Android apps.
5. What is the purpose of the App ID in mobile app development?
o A) To identify the app on the developer's computer
o B) To provide unique identification for the app-on-app stores ✅
o C) To track app downloads
o D) To optimize app performance
✅ The App ID uniquely identifies your app across systems and app stores.
6. What does ASO stand for in the context of mobile applications?
o A) App Store Optimization ✅
o B) Application Security Operations
o C) Application System Organization
o D) App Software Output
✅ ASO involves optimizing an app to rank higher in store search results.
7. Which service is commonly used to monitor crash reports after an app is deployed?
o A) Firebase
o B) UXCam
o C) Sentry
o D) All of the above ✅
✅ All listed tools can monitor crashes, performance, and user experience.

II. Fill in the Blank Questions with Answers

1. The two main types of builds in mobile app development are Debug Build and Release Build.
✅ Debug is used during development; Release is used for production.
2. The APK file format is used to package Android applications for distribution on the Google Play Store.
✅ .apk is the standard Android app packaging format.
3. In iOS development, the final app package is typically distributed as an IPA file.
✅ .ipa stands for iOS App Store Package.
4. The process of App Store Optimization (ASO) involves optimizing the app's listing to improve visibility
and attract more downloads.
✅ ASO improves discoverability of an app in store search.
5. A developer must register with the Apple Developer Program to publish apps on the Apple App Store.
✅ Registration is required for access to app submission tools.
6. To monitor application performance and user experience, developers can use tools like Firebase and
Sentry.
✅ These tools offer real-time monitoring and crash reporting.
7. After deployment, issues related to compatibility problems can arise if the app is not compatible with
certain devices or operating system versions.
✅ Compatibility problems can affect app functionality post-deployment.

III. Match the Terms with Descriptions – Answers

No. Term Description


B) Allows developers to gather feedback from real users before an official
1 Beta Builds
release
2 Release Builds A) Contains polished, stable versions of apps for public use
iOS App Submission
3 E) Uses App Store Connect and requires IPA file submission
Process
4 Google Developer Account C) Requires a one-time registration fee and tax/banking info for sales
5 Just-in-Time Compilation D) Translates code into machine language at runtime
6 AOT Compilation F) Preferred for production due to faster execution and lower memory usage
7 JIT Compilation H) Preferred in development environments for dynamic features

Nosql Database

Learning Outcome 1 – End Assessment (With Answers)


Theoretical Assessment: NoSQL & MongoDB
Q1: Multiple Choice Questions

1. What is a key feature of NoSQL databases? ✅ c) Horizontal scaling ➝ NoSQL databases scale out by
distributing data across multiple servers instead of vertically upgrading a single machine.
2. In MongoDB, what is a collection? ✅ a) A group of documents ➝ Collections are groups of related
JSON-like documents, similar to tables in relational databases.
3. Which term refers to the process of storing and retrieving data without fixed schemas? ✅ c) NoSQL
➝ NoSQL databases allow flexible schemas, unlike relational databases that enforce strict table structures.
4. What is MongoDB's equivalent of a table in relational databases? ✅ d) Collection ➝ Collections
store documents just like tables store rows.
5. Which of the following is a benefit of using MongoDB's indexing feature? ✅ b) Faster data retrieval
➝ Indexing improves query performance by making data access efficient.
6. Which type of NoSQL database does MongoDB fall under? ✅ d) Document ➝ MongoDB is a
document-oriented database storing structured JSON-like documents.
7. What does optimistic locking help prevent in MongoDB? ✅ c) Simultaneous updates from
overwriting data ➝ Optimistic locking prevents data conflicts when multiple users try to modify a
document.
8. Which tool is used to interact with MongoDB in a shell environment? ✅ b) Mongosh ➝ Mongosh is
MongoDB’s official command-line interface.
9. In requirement analysis for a NoSQL database, what is the first step? ✅ b) Identify Key
Stakeholders and End-Users ➝ Understanding the users and their needs is the first step in designing a
database.
10. Which of the following describes the scalability of MongoDB? ✅ c) Supports horizontal scaling
across distributed systems ➝ MongoDB scales across multiple nodes using sharding.

Q2: True or False Statements

1. NoSQL databases are always schema-less and cannot enforce any structure on the data. ❌ False
(MongoDB supports schema validation).
2. MongoDB stores data in the form of tables similar to relational databases. ❌ False (MongoDB stores
collections and documents instead of tables).
3. In MongoDB, documents within the same collection can have different structures. ✅ True
4. Indexing in MongoDB can improve the performance of read operations by making data retrieval
faster. ✅ True
5. Optimistic locking prevents other users from accessing a document while it is being edited. ❌ False
(Optimistic locking allows access but prevents overwrites).
6. In MongoDB, relationships between documents can be modeled by embedding documents or
referencing them. ✅ True
7. Collections in MongoDB always require a predefined structure for documents. ❌ False (Collections
are schema-flexible).
8. MongoDB Atlas is a cloud-based solution that automates the deployment and scaling of MongoDB
databases. ✅ True
9. In the requirements analysis process for a NoSQL database, identifying key stakeholders and end-
users is the first step. ✅ True
10. MongoDB's Compass environment is a command-line tool used for database management. ❌ False
(Compass is a GUI tool, whereas Mongosh is CLI).

Q3: Short Answer Questions

1. What is NoSQL? ➝ A type of database designed for flexibility, scalability, and performance by
avoiding rigid schemas found in SQL-based systems.
2. What is MongoDB and how does it work? ➝ MongoDB is a NoSQL document database that stores
JSON-like documents in collections, providing high availability, indexing, and replication.
3. What is meant by Availability in a NoSQL context? ➝ Ensuring data remains accessible even during
failures through replication and fault-tolerant architecture.
4. What is a Document in MongoDB? ➝ A JSON-like object that holds structured data, similar to rows in
relational databases.
5. What is a Collection in MongoDB? ➝ A logical grouping of documents, similar to tables in relational
databases.
6. How does Indexing work in MongoDB? ➝ Indexes improve query speed by optimizing data retrieval.
Example:

javascript

db.users.createIndex({ age: 1 })
7. How are Relationships managed in NoSQL databases like MongoDB? ➝ Two ways: Embedding
(nested documents) or Referencing (foreign keys-like IDs).
8. What is a Data Model in NoSQL? ➝ A schema design pattern that determines how data is stored and
accessed.
9. What is a Schema in NoSQL databases? ➝ Defines data structure, even though NoSQL databases are
schema-flexible.
10. How are user requirements identified for a database? ➝ By interviewing stakeholders, understanding
data needs, and defining scalability & performance goals.

Practical Assessment: Set Up MongoDB for a Cybercafé


Step 1: Install MongoDB

✅ Download and Install MongoDB

 Windows: Install MongoDB from MongoDB Official Site


 Linux/macOS:

bash

sudo apt install mongodb

✅ Start the MongoDB Server

bash

mongod --dbpath /data/db


Step 2: Create a Database in Mongosh

✅ Launch the MongoDB Shell

bash

mongosh

✅ Create a Database Called ecommerce_db

javascript

use ecommerce_db

✅ Verify Database Creation

javascript

db

🚀 Outcome: The Cybercafé now has a MongoDB infrastructure ready for use!
Theoretical Assessment: NoSQL & MongoDB

Here are the questions aligned with their correct answers for better understanding.

Q1: Multiple Choice Questions

1. Which of the following is a tool used for drawing NoSQL databases? ✅ b) Edraw Max ➝ Edraw
Max is widely used for database diagramming, including ERDs for NoSQL.
2. What is the first step in installing Edraw Max? ✅ b) Download the installer from the official website
➝ The software must first be downloaded before installation.
3. In MongoDB, what is a 'collection'? ✅ b) A group of related documents ➝ Collections store multiple
documents in a schema-flexible way.
4. Which diagram is commonly used to model entity relationships in databases? ✅ b) UML Class
Diagram ➝ UML class diagrams help visualize how entities relate to each other.
5. What does 'sharding' refer to in a NoSQL database like MongoDB? ✅ b) Horizontal partitioning of
data across multiple servers ➝ Sharding splits large datasets across multiple servers for scalability.
6. Which of the following diagrams helps visualize how data flows through a system? ✅ c) Data Flow
Diagram (DFD) ➝ DFDs represent how data moves between entities.
7. What should be considered when designing a conceptual data model? ✅ c) The high-level entities
and their relationships ➝ A conceptual model focuses on entities, attributes, and relationships.
8. What is the primary goal of schema normalization in MongoDB? ✅ b) Ensure minimal data
redundancy ➝ Normalization prevents duplicate data storage, making queries efficient.
9. Which factor should be considered when defining a collection structure in MongoDB? ✅ b)
Application workload and access patterns ➝ Schema design should support efficient querying and
indexing.
10. Which MongoDB design pattern is commonly applied for managing relationships between
documents? ✅ b) Embedding and Referencing ➝ MongoDB supports embedding (nested data) and
referencing (foreign keys-like structures).

Q2: Short Answer Questions

1. What are some popular NoSQL database drawing tools? ✅ Edraw Max, Draw.io, Lucidchart,
ERDPlus, and MySQL Workbench.
2. How do you install Edraw Max for database drawing? ✅ Download the installer → Run the setup →
Follow the installation steps.
3. What are collections in MongoDB, and how do you identify them in a conceptual data model? ✅
Collections are groups of documents, similar to tables in relational databases.
4. How do you model entity relationships in a NoSQL database? ✅ Using ERDs (Entity Relationship
Diagrams) and defining embedded or referenced documents.
5. What is sharding, and how is it applied in MongoDB? ✅ Sharding splits data across multiple
servers, ensuring efficient query execution.
6. What is replication in MongoDB? ✅ Replication creates copies of data on multiple servers for
availability.
7. How do you visualize a high-level data model in a database design? ✅ Using ERDs, UML diagrams,
and Data Flow Diagrams (DFDs).
8. How would you design a conceptual data model for an e-commerce website using MongoDB? ✅
Define collections like Users, Orders, Products, and Payments, modeling relationships
properly.
9. How do you identify the application workload for MongoDB schema design? ✅ Analyze queries,
indexing needs, and read/write operations.
10. What are common schema design patterns used in MongoDB? ✅ Embedding, Referencing,
Extended Reference, and Bucket Pattern.

Practical Assessment: Entity Relationship Diagram (ERD) for ABC Network Company
Steps to Draw the ERD

✅ Step 1: Identify Entities

 Salesperson
 Customer
 Order
 Inventory Item
 Part
 Employee
 Supplier

✅ Step 2: Define Relationships

Business Rule Relationship Type

A salesperson may manage many other salespeople. One-to-Many (Self-Referencing)

A salesperson is managed by only one salesperson. Many-to-One

A salesperson can be an agent for many customers. One-to-Many

A customer is managed by one salesperson. Many-to-One

A customer can place many orders. One-to-Many

An order can be placed by one customer. Many-to-One

An order lists many inventory items. Many-to-Many

An inventory item may be listed on many orders. Many-to-Many

An inventory item is assembled from many parts. One-to-Many

A part may be assembled into many inventory items. Many-to-Many

Many employees assemble an inventory item from many parts. Many-to-Many

A supplier supplies many parts. One-to-Many

A part may be supplied by many suppliers. Many-to-Many

✅ Step 3: Create ERD Using Edraw Max

 Use rectangles for entities (Salesperson, Customer, Order, Inventory Item, Part, Employee, Supplier).
 Use diamonds for relationships (One-to-Many, Many-to-Many).
 Define Primary Keys (PK) in each entity.
 Define Foreign Keys (FK) for relationships.

Final ERD Overview


plaintext

[Salesperson] 1 ----- * [Customer]


[Customer] 1 ----- * [Order]
[Order] * ----- * [Inventory Item]
[Inventory Item] * ----- * [Part]
[Part] * ----- * [Supplier]
[Employee] * ----- * [Inventory Item]

🚀 Outcome: ABC Network Company now has a structured ERD for effective database implementation!

Theoretical Assessment: MongoDB

Below is a structured answer key aligned with each question for better understanding.

A) Multiple Choice Questions with Answers

1. Which command is used to create a new database in MongoDB? ✅ b) USE <db_name> ➝ In


MongoDB, a database is created automatically when you switch to it using USE <db_name> and insert
data.
2. What is the correct command to drop a collection named "users"? ✅ b) db.users.drop() ➝ The
.drop() method removes an entire collection from the database.
3. To rename a collection from "oldCollection" to "newCollection", which command should you use?
✅ c) db.oldCollection.renameCollection("newCollection") ➝ .renameCollection() changes the
name of an existing collection.
4. Which of the following methods is used to insert a document into a collection? ✅ a)
db.collection.insertOne() ➝ .insertOne() adds a single document to a collection.
5. What is the purpose of the updateOne() method in MongoDB? ✅ c) To update a single document
that matches the specified filter. ➝ .updateOne() modifies only one matching document.
6. Which of the following operations will completely replace an existing document? ✅ b) replaceOne()
➝ .replaceOne() replaces the entire document, unlike .updateOne(), which modifies specific
fields.
7. What method would you use to create an index on a field called "email" in a collection named
"users"? ✅ a) db.users.createIndex({"email": 1}) ➝ Indexing improves query speed, sorting
"email" field in ascending order.
8. Which of the following best describes a bulk write operation in MongoDB? ✅ b) Multiple write
operations bundled together to be executed in one request. ➝ Bulk write operations optimize
performance by executing multiple commands at once.
9. In MongoDB, which aggregation method is used to group documents by a specified field? ✅ a)
$group ➝ $group groups documents based on a specified field.
10. What is the purpose of query optimization in MongoDB? ✅ b) To decrease the execution time of
queries. ➝ Query optimization reduces query response time, improving performance.
B) True or False Statements

1. In MongoDB, a database can be created using the command db.createDatabase("myDB"). ❌ False


(Databases are created automatically when documents are inserted).
2. The command to drop a collection in MongoDB is db.collection.drop(). ✅ True
3. You can rename a collection in MongoDB using the command db.collection.rename("newName"). ❌
False (The correct command is .renameCollection()).
4. To insert a document into a MongoDB collection, you can use the db.collection.insertOne() method.
✅ True
5. In MongoDB, the update() method can only add new fields to an existing document and cannot
modify existing ones. ❌ False (It can modify existing fields).
6. The command db.collection.deleteOne() is used to delete a single document from a collection. ✅ True
7. Bulk write operations in MongoDB can only insert documents, not update or delete them. ❌ False
(Bulk operations support insert, update, and delete).
8. Aggregation operations in MongoDB are used for performing complex data transformations and
computations. ✅ True
9. The cursor methods in MongoDB allow for iteration over the results of a query. ✅ True
10. Optimization techniques in MongoDB can include creating indexes to improve query performance.
✅ True

C) Matching MongoDB Terms with Definitions


MongoDB Term Definition

1. MongoDB ✅ H. An open-source NoSQL database suitable for high-volume data storage.

2. NoSQL ✅ A. A type of database that does not require a fixed schema.

3. Replica Set ✅ C. A group of MongoDB instances that maintain the same dataset for high availability.

4. Collections ✅ K. A group of documents, similar to tables in SQL databases.

5. Schema-less ✅ B. A method of organizing data that consists of key-value pairs.

6. Aggregation ✅ J. The process of combining multiple documents to generate aggregated results.

7. Sharding ✅ L. The partitioning of data across multiple servers to improve performance.

8. Mongo Shell ✅ D. A graphical interface for interacting with the database using commands.

9. Capped Collection
E. A storage structure that overwrites its oldest entries when a size limit is reached.

G. A format used to represent data in MongoDB that supports more data types than
10. BSON ✅
JSON.

Practical Assessment: HealthSync Database Optimization


Step 1: Create Database
javascript

use healthSyncDB
Step 2: Define Collections
javascript

db.createCollection("patients")
db.createCollection("appointments")
db.createCollection("medicalRecords")
db.createCollection("billing")
Step 3: Insert Sample Data
javascript

db.patients.insertOne({
name: "John Doe",
age: 35,
address: "123 Health St",
phone: "123-456-7890",
email: "[email protected]",
medicalHistory: ["Diabetes", "High Blood Pressure"]
})
Step 4: Optimize Queries with Indexing
javascript

db.patients.createIndex({ email: 1 })
db.appointments.createIndex({ patientId: 1, date: 1 })
Step 5: Enable Replication for High Availability
javascript

rs.initiate()
Step 6: Implement Aggregation for Reporting
javascript

db.appointments.aggregate([
{ $group: { _id: "$doctorId", totalAppointments: { $sum: 1 } } }
])

🚀 Outcome: HealthSync now has a fully optimized MongoDB database, ready for improved query
performance and scalability!

Theoretical Assessment: MongoDB & Database Security

Below is a structured answer key aligned with each question for better understanding.

Section A: Multiple Choice Questions with Answers

1. What is the primary role of database users? ✅ c) To access and manipulate data ➝ Database users
interact with stored information, performing read, write, and update operations.
2. Which command is used to create a new user in MongoDB? ✅ a) db.createUser() ➝ The
db.createUser() command is used to assign roles and privileges to users.
3. What is the purpose of roles in MongoDB? ✅ b) To define user permissions and privileges ➝ Roles
grant access control over specific database operations.
4. Which of the following is a method to enforce authentication in a database? ✅ d) Creating a user
account with a password ➝ Authentication restricts unauthorized access by requiring valid credentials.
5. What does role-based access control (RBAC) in MongoDB allow administrators to do? ✅ c) Assign
specific roles to users based on their job functions ➝ RBAC ensures users can only perform
operations necessary for their role.
6. Which of the following methods helps protect sensitive data in a database? ✅ b) Enabling data
encryption ➝ Encryption ensures stored data remains secure and unreadable without authorization.
7. What is the purpose of auditing system activity in a database? ✅ b) To track changes and access to
the database ➝ Auditing helps detect potential breaches and security issues.
8. Which deployment option involves hosting the database on physical servers owned by the
organization? ✅ c) On-Premises ➝ On-premises databases are stored on an organization’s internal
servers.
9. Which MongoDB cluster architecture consists of a primary node and multiple secondary nodes? ✅
b) Replica Set ➝ Replica sets ensure high availability by maintaining copies of data.
10. What is the primary benefit of scaling MongoDB with sharding? ✅ c) Increased database
availability and performance ➝ Sharding distributes data across multiple servers, reducing overload
and increasing efficiency.

Section B: True or False Statements

1. The primary role of database users is to manage server hardware and configuration. ❌ False
(Database users interact with stored data, not manage hardware).
2. A user in MongoDB can be created using the command db.createUser() with specific roles assigned.
✅ True
3. Roles in a database are used to assign privileges and control what actions users can perform. ✅ True
4. Enforcing authentication in a database is optional and does not significantly impact security. ❌ False
(Authentication is critical for database security).
5. Role-Based Access Control (RBAC) allows different users to have different permissions based on
their roles within the organization. ✅ True
6. Data encryption ensures that sensitive information in the database is protected from unauthorized
access. ✅ True
7. Auditing system activity in a database is only necessary during the initial setup and not needed
afterward. ❌ False (Ongoing auditing is essential for security monitoring).
8. On-premises deployment of a database means that the database is hosted on the organization's
physical servers. ✅ True
9. A MongoDB sharded cluster allows for horizontal scaling by distributing data across multiple
servers. ✅ True
10. A replica set in MongoDB consists of only one primary node and no secondary nodes. ❌ False (A
replica set includes one primary node and multiple secondary nodes).

Section C: Short Answer Questions

1. What is the primary responsibility of database users? ✅ Access and manipulate data, ensuring
smooth database operations.
2. Which command is used to create a new user in MongoDB? ✅ db.createUser()

javascript

db.createUser({
user: "adminUser",
pwd: "securePassword123",
roles: [{ role: "readWrite", db: "financialDB" }]
})
3. How are roles and privileges managed in a database? ✅ Using Role-Based Access Control (RBAC),
granting users permissions based on roles.
4. What is the purpose of enabling access control in a database? ✅ To prevent unauthorized actions
and improve security by restricting data access.
5. What is Role-Based Access Control (RBAC)? ✅ A security mechanism that assigns permissions to
users based on predefined roles.
6. Why is data encryption important in database security? ✅ To prevent unauthorized access to
sensitive data by encoding information.
7. What is the significance of auditing system activity in a database? ✅ Tracks changes, helps detect
unauthorized access, and improves security.
8. What does an on-premises database deployment involve? ✅ Hosting a database on physical
infrastructure owned by the organization rather than the cloud.
9. Describe the difference between a replica set and a sharded cluster in MongoDB. ✅ Replica Set:
Provides high availability using multiple copies of data. ✅ Sharded Cluster: Distributes data across
multiple servers for scalability.
10. How does sharding improve the performance of a MongoDB database? ✅ By distributing large
datasets across multiple servers, reducing query load per instance.

Practical Assessment: Securing MongoDB in a Financial Company


Step 1: Identify Roles & Privileges

✅ Define user roles:

 Admin: Full access


 Analyst: Read-only access
 Accountant: Write access

✅ Create role-based users:

javascript

db.createUser({
user: "analystUser",
pwd: "securePass",
roles: [{ role: "read", db: "financialDB" }]
})
Step 2: Implement Role-Based Access Control (RBAC)

✅ Assign user permissions:

javascript

db.grantRolesToUser("accountantUser", [{ role: "readWrite", db: "financialDB"


}])
Step 3: Enable Data Encryption

✅ Encrypt sensitive fields before storing data:

javascript

const crypto = require("crypto");


const algorithm = "aes-256-cbc";
const key = crypto.randomBytes(32);
const iv = crypto.randomBytes(16);

function encryptData(data) {
const cipher = crypto.createCipheriv(algorithm, key, iv);
let encrypted = cipher.update(data, "utf8", "hex");
encrypted += cipher.final("hex");
return encrypted;
}

db.clients.insertOne({ name: encryptData("John Doe"), account: "123456789"


});
Step 4: Perform Data Recovery & Prevent Disaster

✅ Enable backups & recovery strategy:

javascript

mongodump --db financialDB --out /backup/


mongorestore --db financialDB /backup/
Step 5: Audit System for Security

✅ Enable logging for tracking activity:

javascript

db.setProfilingLevel(2)

🚀 Outcome: The financial company now has secure user roles, encrypted data, disaster recovery measures,
and audit tracking in place!

PHP

Learning outcome 1

I. Read the following statement related PHP programming and choose the correct letter that corresponds to
the correct answer:

1. Which of the following is a valid PHP variable name?


Answer: C) $variable_name
2. What is the output of the following PHP code?
Answer: A) The number is 5
3. Which of the following is not a characteristic of static websites?
Answer: D) Dynamic Content
4. Which characteristic of PHP describes that PHP applications can be scaled to handle high traffic and large
datasets?
Answer: C) Scalability
5. What is the data type of the variable $array in the following code?
Answer: C) array
6. Which of the following PHP constructs is used to execute a block of code repeatedly while a condition is
true?
Answer: C) while
7. What is the purpose of the break statement in PHP control structures?
Answer: A) To exit the current loop or switch statement
8. Which PHP function is used to check if a key exists in an associative array?
Answer: A) array_key_exists()
9. What will be the output of the following PHP code?
Answer: A) a: 1 b: 2 c: 3
10. Which of the following is the correct way to access the value 2 in the following PHP array?
Answer: B) $numbers[1]

II. Complete the following sentences with appropriate terms used in PHP Programming:

1. To define a function in PHP, you use the function keyword, followed by the function name and
parentheses.
2. To return a value from a PHP function, you use the return statement.
3. To call a function and pass an argument by reference, you use the & symbol before the parameter in the
function definition.

III. Read the following statement related to PHP programming and write the letter corresponding to the
correct answer:

PHP OOP
Answer Explanations
Concepts
B. The practice of hiding the internal implementation details of a class and only
B 1. Encapsulation
exposing the necessary parts of it.
A. The process of creating a new class based on an existing class, allowing the new
A 2. Inheritance
class to inherit properties and methods from the parent class.
C. The ability of different classes to be treated as instances of the same class through a
C 3. Polymorphism
common interface, even though they may behave differently.
D 4. Abstraction D. A special method that is automatically called when an object is instantiated.

Practical Assessment

Task:

DSG Ltd is a company that sells smartphones, tablets, and other digital devices. They need a simple web-based
inventory management system without using a database (using PHP arrays instead).

Solution Outline:

 Create a PHP page that displays available products in a table.


 Allow updating product stock levels.
 Handle product listing using PHP arrays.
Sample PHP Code:

<?php
// Sample Product List
$products = array(
array("id" => 1, "name" => "iPhone 14", "stock" => 10),
array("id" => 2, "name" => "Samsung Galaxy Tab", "stock" => 5),
array("id" => 3, "name" => "Huawei MatePad", "stock" => 7)
);

// Display Products
echo "<h2>Product Inventory</h2>";
echo "<table border='1' cellpadding='10'>";
echo "<tr><th>ID</th><th>Name</th><th>Stock Available</th></tr>";
foreach ($products as $product) {
echo "<tr>";
echo "<td>" . $product['id'] . "</td>";
echo "<td>" . $product['name'] . "</td>";
echo "<td>" . $product['stock'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>

Features:

 Easy to add/update product details.


 Can modify the $products array manually or through simple PHP forms.

Notes:

 For a fully dynamic version, you would create forms and capture user inputs to modify the array during the
session.
 No database needed.

End of Assessment

Written Assessment: PHP Programming

Below is a structured answer key aligned with each question for better understanding.

I. Multiple Choice Questions with Answers

1. What is the primary purpose of user authentication? ✅ c) To confirm the identity of a user ➝
Authentication verifies that a user is who they claim to be.
2. Which PHP function is used to hash passwords securely? ✅ c) password_hash() ➝ password_hash()
securely hashes passwords using bcrypt or Argon2.
3. Which of the following is NOT a common role in a role-based access control system? ✅ b)
Moderator ➝ Common roles include Admin, Editor, Viewer, but "Moderator" is not standard in role-
based access control.
4. What is a common method to prevent SQL injection attacks? ✅ b) Use of prepared statements ➝
Prepared statements prevent SQL injection by separating queries from user input.
5. Which PHP function is used to verify a password against a hashed value? ✅ a) password_verify() ➝
password_verify() compares a plain text password with its hashed version.
6. What is the main difference between authentication and authorization? ✅ b) Authentication verifies
identity, while authorization determines what a user can do.
7. What is a session fixation attack? ✅ b) An attack that involves creating a fake session to impersonate
a user. ➝ Session fixation forces a user to use a predefined session ID, allowing attackers to hijack
sessions.
8. Which HTTP method is typically used for user login forms? ✅ b) POST ➝ POST requests safely
send user credentials to the server.
9. What should be done to enhance session security in PHP? ✅ a) Use session cookies with the Secure
and HttpOnly flags. ➝ This prevents session hijacking and cross-site scripting (XSS) attacks.
10. Which of the following is a common technique to protect against Cross-Site Request Forgery
(CSRF)? ✅ b) Implementing CSRF tokens ➝ CSRF tokens prevent malicious form submissions from
unauthorized sources.
11. Which of the following is a purpose of using a database connection driver in PHP? ✅ b) To enable
PHP scripts to communicate with a database server.
12. When using the PDO (PHP Data Objects) extension for database connections, which of the following
statements is true? ✅ b) PDO provides a unified API for accessing various database management
systems. ➝ PDO supports multiple database systems, making it flexible.
13. Which PHP function is used to execute an SQL query that inserts a new record into a MySQL
database using the MySQLi extension? ✅ A) MySQLi_query()
14. Which method is used to update an existing record in a database using PDO in PHP? ✅ C)
PDO::prepare()
15. Which of the following PHP functions is commonly used to prevent SQL Injection by escaping
special characters in a query string? ✅ B) MySQLi_real_escape_string() ➝ Escapes characters,
preventing SQL injection attacks.
16. To protect against Cross-Site Scripting (XSS) attacks, which function should be used to convert
special characters to HTML entities in user-generated content before outputting it to the browser?
✅ A) htmlspecialchars()
17. Which PHP function can be used to set a custom error handler that replaces the default error
handling mechanism? ✅ B) set_error_handler()
18. When an exception is thrown in PHP, which block of code is used to catch and handle the exception?
✅ A) catch

II. Fill in the Blanks

1. In a role-based access control system, the ✅ role defines what actions a user can perform within an
application.
2. To securely store user passwords in a database, you should use ✅ password_hash() to hash the
passwords before storing them.
3. The PHP function ✅ password_verify() is used to compare a plaintext password with a hashed
password.
4. When a user logs in, their authentication state is typically managed using a ✅ session.
5. To prevent unauthorized access to certain pages, you should check the user's ✅ authorization at the
beginning of each protected page.
III. Matching PHP Security Terms
Term Definition

1. Authentication ✅ b. The process of verifying a user's identity.

2. Authorization ✅ d. The process of determining what actions an authenticated user can perform.

3. Session Hijacking
c. The act of taking over a user's active session.

a. A security measure to prevent attacks where an attacker tricks a user into making
4. CSRF Token ✅
unwanted requests.

Practical Assessment: Web Application for TWIGIRE MUHINZI COOPERATIVE


Step 1: User Authentication

✅ Create User Registration with Password Hashing

php

$password = password_hash($_POST['password'], PASSWORD_BCRYPT);

$pdo->prepare("INSERT INTO users (username, password) VALUES (?, ?)")


->execute([$_POST['username'], $password]);

✅ Login with Password Verification

php

$stmt = $pdo->prepare("SELECT * FROM users WHERE username = ?");


$stmt->execute([$_POST['username']]);
$user = $stmt->fetch();

if (password_verify($_POST['password'], $user['password'])) {
$_SESSION['user_id'] = $user['id'];
}
Step 2: Role-Based Access Control

✅ Define User Roles

php

$roles = ["Admin", "Manager", "Member"];

$pdo->prepare("INSERT INTO roles (role_name) VALUES (?)")


->execute(["Admin"]);

✅ Assign Roles to Users

php

$pdo->prepare("UPDATE users SET role = ? WHERE id = ?")


->execute(["Manager", $user_id]);

✅ Restrict Access Based on Roles

php

if ($_SESSION['role'] !== "Admin") {


die("Access Denied");
}
Step 3: Record Members, Clients, and Products

✅ Insert Member Data

php

$pdo->prepare("INSERT INTO members (name, harvest_quantity) VALUES (?, ?)")


->execute([$_POST['name'], $_POST['harvest_quantity']]);

✅ Update Client Data

php

$pdo->prepare("UPDATE clients SET company_name = ? WHERE id = ?")


->execute([$_POST['company_name'], $_POST['client_id']]);

✅ Delete Sales Records

php

$pdo->prepare("DELETE FROM sales WHERE id = ?")


->execute([$_POST['sale_id']]);
Step 4: Generate Sales & Product Reports

✅ Generate Reports Using SQL Queries

php

$stmt = $pdo->prepare("SELECT * FROM sales WHERE date BETWEEN ? AND ?");


$stmt->execute([$_POST['start_date'], $_POST['end_date']]);

$sales = $stmt->fetchAll();
foreach ($sales as $sale) {
echo "Sale Amount: " . $sale['amount'] . "<br>";
}

🚀 Outcome: TWIGIRE MUHINZI COOPERATIVE now has a fully functional web application for
managing members, clients, products, and sales with authentication, role-based access control, and reporting
capabilities!

Written Assessment: PHP Frameworks & Development

Below is the structured answer key aligned with each question for better understanding.
I. Multiple Choice Questions with Answers

1. Which of the following is a key advantage of using a PHP framework? ✅ C) Streamlined code
organization ➝ PHP frameworks provide structured, organized code, reducing development time.
2. Which PHP framework is known for its simplicity and speed, often used for building RESTful APIs?
✅ C) CodeIgniter ➝ CodeIgniter is a lightweight framework known for fast performance.
3. Which PHP framework uses the Eloquent ORM for database interactions? ✅ B) Laravel ➝
Eloquent ORM simplifies database queries in Laravel.
4. In Laravel, which command is used to create a new controller? ✅ A) php artisan make:controller ➝
The make:controller command generates a new controller in Laravel.
5. What does MVC stand for in the context of PHP frameworks? ✅ C) Model-View-Controller ➝
MVC is a design pattern that separates data (Model), UI (View), and logic (Controller).

II. Fill in the Blanks

1. Swagger is an open-source tool for designing, building, and documenting APIs.


2. Postman is a popular tool for testing APIs, and it also provides powerful features for API documentation.
3. The MVC pattern is commonly used in PHP frameworks to separate concerns in web applications.
4. In Symfony, the HttpFoundation component is responsible for handling HTTP requests and responses.
5. Laravel’s Eloquent ORM provides a simple and expressive syntax for database queries.
6. CodeIgniter is known for its small footprint, making it suitable for shared hosting environments.
7. In CakePHP, Models are used to validate and handle data before saving it to the database.

III. True or False Statements

1. PHP frameworks like Laravel and Symfony are designed to help developers build web applications
faster and more securely. ✅ True
2. The Zend Framework is now known as Laminas. ✅ True
3. CodeIgniter requires the use of the Eloquent ORM for database operations. ❌ False (CodeIgniter
does not require Eloquent ORM; it has its own query builder.)
4. In Laravel, middleware is used to filter HTTP requests entering your application. ✅ True
5. Symfony’s components are reusable PHP libraries that can be used independently of the full
framework. ✅ True

Practical Assessment: Web Application Development for InnovateTech


Step 1: Setting Up Laravel Environment

✅ Install Laravel using Composer

bash

composer create-project --prefer-dist laravel/laravel nonprofit-app

✅ Create Database Migration

bash

php artisan make:migration create_donors_table


Step 2: Designing the Database Schema

✅ Define donors Table in Migration

php

Schema::create('donors', function (Blueprint $table) {


$table->id();
$table->string('name');
$table->string('email')->unique();
$table->decimal('donation_amount', 10, 2);
$table->timestamps();
});
bash

php artisan migrate


Step 3: Implementing Models, Views, and Controllers

✅ Create Model for Donors

bash

php artisan make:model Donor


php

class Donor extends Model {


protected $fillable = ['name', 'email', 'donation_amount'];
}

✅ Create Controller for Donor Management

bash

php artisan make:controller DonorController


php

class DonorController extends Controller {


public function store(Request $request) {
Donor::create($request->all());
return response()->json(['message' => 'Donor saved successfully']);
}
}
Step 4: Setting Up Routes

✅ Define API Routes for Donor Management

php

Route::post('/donors', [DonorController::class, 'store']);


Route::get('/donors', [DonorController::class, 'index']);
Route::delete('/donors/{id}', [DonorController::class, 'destroy']);
Step 5: Implementing Authentication and Authorization

✅ Install Laravel Authentication

bash

composer require laravel/ui


php artisan ui bootstrap --auth

✅ Protect Routes with Middleware

php

Route::middleware('auth')->group(function () {
Route::get('/dashboard', function () {
return view('dashboard');
});
});
Step 6: Developing a User-Friendly Interface

✅ Create Blade Templates for Admin Dashboard

php

@extends('layouts.app')

@section('content')
<h2>Donor Management</h2>
<table>
<tr>
<th>Name</th>
<th>Email</th>
<th>Donation Amount</th>
</tr>
@foreach ($donors as $donor)
<tr>
<td>{{ $donor->name }}</td>
<td>{{ $donor->email }}</td>
<td>${{ $donor->donation_amount }}</td>
</tr>
@endforeach
</table>
@endsection

✅ Design Responsive UI using Bootstrap

html

<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css
">
Step 7: Testing the Application

✅ Run Laravel Server

bash

php artisan serve

✅ Use Postman for API Testing

 POST /donors → Insert a new donor


 GET /donors → Retrieve all donors
 DELETE /donors/{id} → Delete a donor

Step 8: Generating Reports

✅ Retrieve Donor Reports

php

public function report() {


return Donor::select('name', 'donation_amount')->get();
}
php

Route::get('/donor-report', [DonorController::class, 'report']);

🚀 Outcome: InnovateTech now has a well-structured Laravel web application that manages donor
information, fundraising events, and generates reports efficiently!

Would you like additional enhancements, such as payment gateway integration or automated donation
tracking? 🚀💻

ere is a structured answer key, aligning each question with its correct response for better understanding.

I. Multiple Choice Questions with Answers

1. What should be the first step when implementing a logout feature in PHP? ✅ b) Destroy the session
➝ Destroying the session removes all session data, logging out the user properly.
2. What is the function of the require_login() function in a CMS? ✅ a) To check if a user is logged in ➝
This function ensures only authenticated users can access certain pages.

II. Fill in the Blanks

1. In PHP, the function used to start a session is ✅ session_start()


2. The PHP function ✅ password_hash() is used to create a secure hash of a password.
III. True or False Statements

1. Sessions in a CMS can be used to maintain the logged-in state of a user across multiple pages. ✅
True
2. Sanitizing user inputs is unnecessary if your CMS has user authentication. ❌ False (Sanitization
prevents SQL injection and XSS attacks, making authentication more secure.)
3. The password_verify() function in PHP is used to compare a user's entered password with the hashed
password stored in the database. ✅ True
4. Cookies can be used to store user preferences like themes or login details, enhancing the user
experience in a CMS. ✅ True
5. To create a new admin account in a CMS, you should store the password in plain text for easy
retrieval. ❌ False (Passwords should always be hashed using password_hash() for security.)

IV. Matching PHP Error Testing Approaches


Error Testing Approach Significance

h. Re-running previous tests after updates to ensure new code has not introduced
1. Regression Testing ✅
errors.

2. Load Testing ✅ g. Evaluating how the CMS handles multiple users accessing it simultaneously.

3. Functional Testing ✅ c. Verifying that the CMS meets the specified requirements by testing its features.

4. Performance Testing
f. Assessing how the CMS performs under various conditions, including high traffic.

5. Integration Testing ✅ b. Ensuring different components work together seamlessly.

6. Security Testing ✅ e. Identifying vulnerabilities in the CMS, such as SQL injection or XSS attacks.

7. Unit Testing ✅ a. Testing individual components of the CMS to ensure they function correctly.

8. Usability Testing ✅ d. Ensuring the CMS is user-friendly and intuitive for users.

Practical Assessment: Building a CMS for Visionary Web Solutions


Step 1: Setting Up the CMS Architecture

✅ Install PHP and Laravel for Scalability

bash

composer create-project --prefer-dist laravel/laravel cms-project

✅ Set Up MySQL Database Connection

php

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=cms_database
DB_USERNAME=root
DB_PASSWORD=securepassword

✅ Create Migrations for CMS Database Schema

bash

php artisan make:migration create_contents_table


php

Schema::create('contents', function (Blueprint $table) {


$table->id();
$table->string('title');
$table->text('body');
$table->timestamps();
});
Step 2: Implementing User Authentication

✅ Generate Authentication Scaffold

bash

php artisan ui bootstrap --auth

✅ Create User Model and Define Role-Based Access

php

class User extends Authenticatable {


protected $fillable = ['name', 'email', 'password', 'role'];
}

✅ Hash User Passwords Upon Registration

php

User::create([
'name' => 'Admin',
'email' => '[email protected]',
'password' => password_hash('securepassword', PASSWORD_BCRYPT),
'role' => 'admin'
]);
Step 3: Developing CRUD Operations for Content Management

✅ Create Controller for Managing Content

bash

php artisan make:controller ContentController


php

public function store(Request $request) {


Content::create($request->all());
return redirect('/dashboard')->with('message', 'Content saved
successfully');
}

✅ Define Routes for CMS

php

Route::post('/content', [ContentController::class, 'store']);


Route::get('/content', [ContentController::class, 'index']);
Route::delete('/content/{id}', [ContentController::class, 'destroy']);
Step 4: Securing the CMS

✅ Implement CSRF Protection in Forms

php

<form method="POST" action="/content">


@csrf
<input type="text" name="title">
<textarea name="body"></textarea>
<button type="submit">Save</button>
</form>

✅ Restrict Routes Based on User Role

php

if (auth()->user()->role !== 'admin') {


return abort(403);
}

✅ Enable HTTPS for Secure Connections

php

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Step 5: Testing the CMS

✅ Run Laravel Server

bash

php artisan serve

✅ Test APIs Using Postman

 POST /content → Add new content


 GET /content → Retrieve content listings
 DELETE /content/{id} → Remove content
✅ Perform Load Testing Using Apache Benchmark

bash

ab -n 1000 -c 100 http://localhost:8000/content

🚀 Outcome: Visionary Web Solutions now has a functional, secure, and scalable CMS that enables
administrators to manage content dynamically!

Database Development
Learning Unit 1: Perform Database Structure
1. What is the primary purpose of a database?

✅ To store, organize, and manage data efficiently. ➝ Databases allow structured data storage, easy retrieval,
and manipulation.

2. What are the types of databases?

✅ Relational (SQL) and Non-Relational (NoSQL) ➝ Relational databases use tables, while NoSQL databases
use documents, key-values, graphs, or columns.

3. What is the difference between primary and foreign keys?

✅ A primary key uniquely identifies each record, while a foreign key links two tables together. ➝ Primary
keys prevent duplicate values, ensuring data integrity, while foreign keys establish relationships between tables.

4. What is normalization in databases?

✅ Normalization organizes data to reduce redundancy and improve efficiency. ➝ It divides large tables into
smaller ones while maintaining relationships.

5. What are database constraints?

✅ Constraints define rules to ensure data integrity. Examples:

 PRIMARY KEY → Ensures each row is unique


 FOREIGN KEY → Establishes relationships between tables
 NOT NULL → Prevents empty values
 UNIQUE → Ensures all values in a column are different
 CHECK → Enforces specific conditions

Learning Unit 2: Apply DML Queries


6. What does DML stand for?

✅ Data Manipulation Language ➝ DML commands modify data within tables without affecting the structure.
7. What are the main DML commands in SQL?

✅ INSERT, UPDATE, DELETE, SELECT ➝ These commands insert, modify, remove, and retrieve data
from tables.

8. What is the purpose of the SELECT statement?

✅ To retrieve specific or all data from a table.

sql

SELECT * FROM customers;


SELECT name, email FROM employees;
9. How do you insert data into a table using SQL?

✅ INSERT statement adds records to a table.

sql

INSERT INTO students (name, age) VALUES ('John Doe', 20);


10. How can you update an existing record in a table?

✅ UPDATE statement modifies existing data.

sql

UPDATE employees SET salary = 55000 WHERE id = 3;


11. How do you delete a record from a table?

✅ DELETE statement removes records.

sql

DELETE FROM products WHERE id = 7;


Learning Unit 3: Interact with Databases using SQL
12. What is SQL?

✅ Structured Query Language (SQL) is used to manage and manipulate databases.

13. What are the types of SQL queries?

✅ DML, DDL, DCL, TCL

 DML (Data Manipulation Language) → SELECT, INSERT, UPDATE, DELETE


 DDL (Data Definition Language) → CREATE, ALTER, DROP
 DCL (Data Control Language) → GRANT, REVOKE
 TCL (Transaction Control Language) → COMMIT, ROLLBACK
14. How do you create a new table in SQL?

✅ Using the CREATE TABLE command.

sql

CREATE TABLE employees (


id INT PRIMARY KEY,
name VARCHAR(100),
age INT,
salary DECIMAL(10,2)
);
15. What is a JOIN operation in SQL?

✅ JOIN combines rows from two or more tables based on a related column.

sql

SELECT orders.id, customers.name


FROM orders
JOIN customers ON orders.customer_id = customers.id;
16. How do you count rows in a table?

✅ Using COUNT() function.

sql

SELECT COUNT(*) FROM employees;


17. How can you group data in SQL?

✅ Using GROUP BY to aggregate data based on a column.

sql

SELECT department, COUNT(*) FROM employees GROUP BY department;


18. What is the difference between DELETE and TRUNCATE?

✅ DELETE removes specific rows, while TRUNCATE removes all rows but keeps the structure.

Frontend AND Design Development

Theoretical Assessment

Multiple Choice Questions:


6. What is React Router primarily used for?
Answer: b) Navigation between different views
7. Which method unmounts a React component?
Answer: a) componentWillUnmount
8. Which React hook would you use to run side effects?
Answer: b) useEffect
9. What does Redux help manage in a React application?
Answer: b) Global state
10. Which event type in React is responsible for handling input changes?
Answer: b) onChange
11. What is a synthetic event in React?
Answer: b) A wrapper around browser native events
12. In React, which function is used to handle API calls?
Answer: b) fetch
13. The main purpose of the Context API in React is:
Answer: b) State management across components
14. What method is used to prevent event bubbling in React?
Answer: c) stopPropagation
15. How is a controlled component defined in React?
Answer: c) A component whose form data is handled by React state
16. What does the useEffect hook do?
Answer: a) Handles side effects in function components
17. What does the Redux store represent?
Answer: b) The global state for a React application
18. What is the main use of MobX in React applications?
Answer: b) Manage global state
19. What is the purpose of componentDidUpdate in React?
Answer: b) To perform actions after a component rerenders
20. How can you perform routing in React?
Answer: c) Using React Router

True or False Statements:

1. JSX allows embedding HTML within JavaScript code


Answer: TRUE
2. The useState hook is used for side effects in React components
Answer: FALSE
3. The Virtual DOM helps improve the performance of React applications
Answer: TRUE
4. Props are mutable in React components
Answer: FALSE
5. The useEffect hook is equivalent to all three lifecycle methods in class components.
Answer: TRUE
6. Redux is mainly used to manage local component state.
Answer: FALSE
7. React Router helps in managing state transitions.
Answer: FALSE
8. The Context API is a way to avoid passing props through multiple components
Answer: TRUE
9. A synthetic event in React is a cross-browser wrapper around native events
Answer: TRUE
10. The componentWillUnmount method is used to clean up after a component is removed
Answer: TRUE
11. React components rerender when their props or state changes
Answer: TRUE
12. In JSX, class names are assigned using the class attribute
Answer: FALSE
13. Lifecycle methods are only available in class components
Answer: TRUE
14. The bind() method is used to bind event handlers in functional components
Answer: FALSE
15. MobX is a state management tool similar to Redux
Answer: TRUE
16. A controlled component uses internal state to manage form data
Answer: FALSE
17. Context API and Redux both solve global state management problems
Answer: TRUE
18. Nested routing is supported by React Router
Answer: TRUE
19. Events in React follow the same event delegation as vanilla JavaScript
Answer: TRUE
20. React Developer Tools is used to debug and inspect components in a browser
Answer: TRUE

Fill-in-the-Blank:

1. JSX stands for JavaScript XML.


2. React Router is used for navigation between different components or pages.
3. The useState hook is used to manage state in functional components.
4. The componentDidMount lifecycle method is called after a component has been rendered to the DOM.
5. A functional component in React is a JavaScript function that returns JSX.
6. React allows developers to manage state using both hooks and class components.
7. Synthetic events are a cross-browser wrapper around browser’s native events.
8. A Virtual DOM in React is an in-memory representation of the real DOM.
9. The useEffect hook is primarily used for handling side effects.
10. Redux helps in managing global state in large React applications.
11. The React Context API is used for passing data through the component tree without props.
12. Props in React are passed from parent components to child components.
13. To prevent an event from bubbling up the DOM, you would use event.stopPropagation().
14. MobX and Redux are both state management libraries.
15. The componentWillUnmount lifecycle method is used to clean up resources before a component is
removed from the DOM.
16. The bind() method in React is used to bind event handlers to class components.
17. The useCallback hook in React is used to memorize callback functions.
18. A controlled component’s form data is handled by state.
19. URL parameters in React Router are handled using the useParams method.
20. To handle asynchronous data fetching in React, you can use the useEffect hook or async/await.

Practical Assessment

To build the Product Listing and Search Page for ABC Company, the following React.js concepts should be
implemented:
 Search Bar: Implement a search bar that filters products by name, category, or price.
 Filters: Add filters such as categories, price range, and brand.
 Product Listing: Display the products in a grid or list format with relevant information such as the product
name, price, and image.
 Product Details: Allow users to click on a product to view more details, including descriptions and
specifications.
 State Management: Use useState and useEffect hooks to manage and update the product data
dynamically.
 Routing: Use React Router to navigate between the product listing page and individual product details
pages.

Ensure that the page is responsive and provides a smooth user experience by incorporating dynamic features such as
product search, sorting, and real-time filtering.

If you need help with code snippets or further explanation on any part, feel free to ask!

4o mini

You said:

Question 1. Choose the correct alternative by circling the letter that corresponds to the answer 1. What is JSX in
React? a) A JavaScript framework b) A JavaScript XML syntax extension c) A state management library d) A CSS
library 2. Which of the following is a lifecycle method in React? a) render b) componentDidMount c) useEffect d)
setState 3. Which hook is used to manage state in functional components? a) useState b) useEffect c) useContext d)
useReducer 4. Which of the following is a valid way to pass props in React? a) Using state b) Through the
constructor c) As an attribute in JSX d) Through the render method 5. What does the Virtual DOM do? a) Stores
component states b) Provides routing in React c) Minimizes the number of DOM manipulations

ChatGPT said:

Here are the correct answers for your multiple-choice questions:

1. What is JSX in React?


Answer: b) A JavaScript XML syntax extension
2. Which of the following is a lifecycle method in React?
Answer: b) componentDidMount
3. Which hook is used to manage state in functional components?
Answer: a) useState
4. Which of the following is a valid way to pass props in React?
Answer: c) As an attribute in JSX
5. What does the Virtual DOM do?
Answer: c) Minimizes the number of DOM manipulations

Theoretical Assessment: Tailwind CSS Framework

Q1: True or False Statements

Statement Answer Explanation


a) Tailwind CSS does not support grid-based layouts ❌ Tailwind supports grid-based layouts through
for creating flexible, responsive designs. False utilities like grid and grid-cols-{n}.
Statement Answer Explanation
b) The mobile-first approach means designing for The mobile-first approach ensures optimized
smaller screens first and progressively enhancing the ✅ experiences on smaller screens first before
layout for larger screens. True scaling up.
c) Tailwind CSS does not allow developers to Tailwind supports custom typography and

customize typography or scale font sizes for responsive font sizes via text-lg, text-xl,
responsive design. False
and configuration settings.
d) Tailwind CSS offers utility classes to style
interactive elements such as buttons, forms, and ✅ Utility classes like hover:bg-blue-500 help
True style interactive elements easily.
hover states, ensuring responsiveness.
e) Testing responsiveness and iterating on design are Tailwind provides responsive utilities, but testing

not necessary when using Tailwind CSS because it ensures proper functionality across different
automatically makes everything responsive. False devices.
f) You can extend Tailwind’s default theme by ✅ Developers can customize Tailwind via
modifying the tailwind.config.js file. True tailwind.config.js.
g) Custom fonts can be added to Tailwind by Fonts can be customized in Tailwind via theme:
✅ { fontFamily: { custom: ['Your
specifying them in the theme's fontFamily section
True
of the configuration file. Font', 'sans-serif'] } }.
h) Tailwind CSS plugins can add additional utilities ✅ Plugins extend Tailwind’s capabilities by adding
and variants for extended functionality. True new utilities and components.
i) You can apply conditional styles in Tailwind by
✅ Conditional styling can be achieved using state
integrating JavaScript logic using libraries like
True management in Alpine.js, React, or Vue.js.
Alpine.js or React’s state management.

Q2: Fill in the Blanks

Question Answer
a) ______ in Tailwind CSS is a feature that allows you to apply styles to an element when a
Hover state
user hovers over it with their cursor.
b) You can add plugins by installing them and then including them in the plugins array of
tailwind.config.js
______
c) The ______ approach is a design strategy where you prioritize mobile users by
mobile-first
designing for smaller screens first and then progressively enhancing for larger screens.
d) Add the ______ utility to make an element bounce up and down, useful for things like
animate-bounce
“scroll down” indicators.
e) ______ is the ability to apply motion effects to elements, either using pre-defined utility
Animation
classes or custom animations.
f) You can customize the primary color by extending the ______ property in
colors
tailwind.config.js
g) Use the ______ utilities to control an element’s transition-delay. *delay- **
h) TailwindCSS provides pre-configured ______ through its breakpoint utilities like sm,
media queries
md, lg, xl, and 2xl.
i) Use ______ to allow a flex item to shrink but not grow, taking into account its initial size. flex-initial
j) In TailwindCSS, you can implement flexible grid layouts using the ______ utility class
grid
and specifying the number of columns with grid-cols-{n}.

Q3: Matching Column A with Column B


Correct Match (Column
Column A
B)
1. Utilities for controlling gutters between grid and flexbox items ✅ D. Gap
2. Utility for controlling the size of implicitly-created grid rows. ✅ F. Auto-rows-fr
3. Utility for controlling the size of implicitly-created grid columns. ✅ A. Auto-cols-min
4. Utility for specifying the rows in a grid layout. ✅ G. grid-rows-5
5. It is used to prevent a flex item from shrinking. ✅ B. shrink-0
6. It is used to make an element gently fade in and out, useful for things like skeleton
loaders. ✅ C. animate-pulse

7. It is used to add margins to a paragraph. ✅ I. m-4


8. It is used to apply line spacing to text. ✅ J. leading-normal
9. Example of a breakpoint. ✅ H. md
10. It is used to apply an extra-large size to text. ✅ K. text-xl

Practical Assessment: Modern ReactJS Web Application with Tailwind CSS

Objective: Enhance ABC Company's ReactJS application with Tailwind CSS for modern, responsive UI.

Step 1: Install Tailwind CSS in ReactJS

✅ Add Tailwind via npm

bash
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

✅ Configure Tailwind in tailwind.config.js

js
module.exports = {
content: ["./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {
colors: {
primary: "#0077b6",
secondary: "#00b4d8",
},
},
},
plugins: [],
};

Step 2: Implement Responsive Layout

✅ Create Flexbox Navigation

jsx
<nav className="bg-primary flex justify-between items-center p-4">
<h1 className="text-white text-xl">ABC Company</h1>
<ul className="hidden md:flex space-x-4">
<li className="hover:text-secondary">Home</li>
<li className="hover:text-secondary">About</li>
<li className="hover:text-secondary">Contact</li>
</ul>
</nav>

✅ Grid-Based Layout

jsx
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
<div className="p-4 bg-white shadow-md">Card 1</div>
<div className="p-4 bg-white shadow-md">Card 2</div>
<div className="p-4 bg-white shadow-md">Card 3</div>
</div>

Step 3: Add Animations & Transitions

✅ Hover Effects

jsx
<button className="bg-primary hover:bg-secondary transition-all duration-300
p-4 rounded-lg">
Click Me
</button>

✅ Bounce Animation

jsx
<div className="animate-bounce text-center text-2xl">Scroll Down</div>

✅ Fade-in Animation

jsx
<div className="animate-pulse bg-gray-300 h-12 w-48"></div>

Step 4: Improve Mobile Experience

✅ Mobile-first Approach

jsx
<div className="p-4 md:p-8 lg:p-12">
<h1 className="text-2xl md:text-3xl lg:text-4xl">Welcome to ABC</h1>
</div>

✅ Media Queries (Hidden on Large Screens)

jsx
<div className="md:hidden p-4 bg-secondary text-white">Mobile Menu</div>

🚀 Outcome: ABC Company now has a clean, modern ReactJS web application using Tailwind CSS with
animations, transitions, and responsive design!
Learning Outcome 5 - End Assessment

Q1. TRUE / FALSE – React Application Deployment


a) Environment variables in a React application can be used to store sensitive information such as backend host,
FTP host, FTP username, and FTP password. → TRUE

b) Changing the value of an environment variable requires restarting the development server for the changes to
take effect. → TRUE

c) Vercel supports automatic deployments from a Git repository, allowing for continuous integration. → TRUE

d) When migrating application files to a deployment platform, it's unnecessary to include configuration files like
package.json. → FALSE

e) React applications can use platform-specific options for environment variable configurations. → TRUE

f) Testing the deployed application is important to ensure that it works as expected in the production
environment. → TRUE

g) You can directly access environment variables in React without prefixing them with REACT_APP_. → FALSE

h) It is best practice to keep all environment variables in a single .env file for security purposes. → FALSE

i) After configuring DNS settings, it is unnecessary to wait for DNS propagation to take effect. → FALSE

j) You can create separate .env files for different environments (e.g., .env.development, .env.production) in a React
application. → TRUE

k) Migrating application files involves copying only the src folder from your React application. → FALSE

l) After deploying a React application, you should avoid running any performance audits to ensure the app
functions correctly. → FALSE

m) Verifying SSL settings can be done by accessing the website and checking if the URL starts with "http://" instead
of "https://". → FALSE

Q2. Fill in the blanks


a) The command …………………………… is used to create a production-ready build of a React application. → npm run
build

b) You can set environment variables in ReactJS by creating a ………………………… file in the root of your project. →
.env

c) Add an ……………………………………… to point your domain to the IP address of the server hosting your React
application. → A Record

d) Variables should be prefixed with ………………………………………… for React to recognize them → REACT_APP_

e) Use the command ………………………………… to check if your domain resolves to the correct IP address. →
nslookup

f) The ……………………………… is returned to the browser, which uses it to connect to the server. → IP address

g) The top of the DNS hierarchy represented by a ………………………………. symbol. → dot(.)


Q3. Matching Terms
1 → DNS → It is a system that translates human-readable domain names into machine-readable IP addresses.

2 → SSL → A standard security technology used to establish an encrypted link between a server and a client.

3 → HTTPS → An extension of HTTP that adds an extra layer of security.

4 → FTP host → The server or system that provides the File Transfer Protocol service.

5 → CNAME Record → A type of DNS record that maps an alias name to a true or canonical domain name.

6 → Top-Level Domain → The last part of a domain name, appearing after the final dot.

7 → Root Level → The top of the hierarchy, represented by the dot (.) at the end of the domain.

8 → IP address → A unique identifier assigned to devices connected to a network using the Internet Protocol.

9 → ISP → A company that provides individuals and organizations access to the internet.

10 → Domain registrar → A company or organization that manages the reservation of Internet domain names.

Practical Assessment
ABC company is located in Kigali City. They hired a React.js developer to deploy a customer feedback system on
Vercel, with a custom domain (www.abc.com).

You are tasked with the following:

1. 1. Configure DNS Settings

• Go to your domain registrar and add a CNAME record for www.abc.com pointing to yourproject.vercel.app.

• If needed, add an A record pointing to Vercel’s IP.

2. 2. Set up SSL for HTTPS

• Vercel will automatically provide SSL after DNS is configured.

• No manual SSL installation is required.

3. 3. Test and Verify

• Use `nslookup www.abc.com` to confirm DNS resolution.

• Open https://www.abc.com and ensure the site loads securely without warnings.

Data Structure(DSA)

Written Assessment

Section 1: Multiple Choice Questions

1. Convert the binary number 1101 to its decimal equivalent. a) 11 b) 12 c) 13 ✅ d) 14


2. Convert the decimal number 29 to its binary equivalent. a) 11101 ✅ b) 10101 c) 11011 d) 10011
3. What is the hexadecimal equivalent of the binary number 10110110? a) B6 ✅ b) 76 c) A6 d) C6
4. Convert the octal number 345 to its decimal equivalent. a) 229 ✅ b) 229 c) 221 d) 231
5. What is the result of converting the hexadecimal number 2A to binary? a) 101010 ✅ b) 110010 c) 100101
d) 111000
6. Which logic gate has an output of 1 only when both of its inputs are 1? a) OR b) AND ✅ c) NOT d) XOR
7. The output of an OR gate is 1 if: a) Both inputs are 0 b) At least one input is 1 ✅ c) Both inputs are 1
d) Both inputs are different
8. If you want to build a circuit that outputs 1 when either input A is 1 or both inputs B and C are 1, which
combination of gates would you use? a) OR and NOT b) AND and OR ✅ c) AND and NAND d) XOR
and NOR
9. Which of the following is a universal gate? a) AND b) OR c) XOR d) NAND ✅
10. What is the decimal equivalent of the hexadecimal number 7F? a) 127 ✅ b) 126 c) 124 d) 121
11. Which logic gate can be used to invert a binary input? a) AND b) OR c) NOT ✅ d) XOR

Section 2: True or False Statements

1. In JavaScript, the keyword var is used to declare a variable. ✅ True


2. JavaScript variables are case-sensitive, meaning myVar and myvar are considered the same
variable. ❌ False (They are considered different variables.)
3. A JavaScript variable name cannot start with a number. ✅ True
4. In JavaScript, a variable declared with const can be reassigned later in the code. ❌ False (const
variables cannot be reassigned.)
5. JavaScript supports both let and const for block-level variable declarations. ✅ True
6. The + operator in JavaScript can be used for both addition and concatenation. ✅ True
7. The === operator checks for equality without type coercion in JavaScript. ✅ True
8. The assignment operator in JavaScript is represented by ==. ❌ False (The assignment operator is =.)
9. In JavaScript, the && operator returns true only if both operands are true. ✅ True
10. JavaScript has a ternary operator represented by ?: that can be used for conditional expressions. ✅
True

Practical Assessment: Algorithm for Student Performance Calculation

Pseudocode for Total and Average Calculation

plaintext
BEGIN
DEFINE subjects[5]
DECLARE total_marks = 0
DECLARE average_marks

FOR each subject mark in subjects:


total_marks = total_marks + mark

average_marks = total_marks / 5

IF average_marks >= 50 THEN


PRINT "Student has passed"
ELSE
PRINT "Student has failed"
ENDIF
END

Flowchart Overview
1. Start
2. Input marks for 5 subjects
3. Calculate total marks
4. Calculate average marks
5. Check if average is >= 50
o If Yes, Print "Student has passed"
o If No, Print "Student has failed"
6. End

Written Assessment

I. Multiple Choice Questions

1. Which of the following is an example of a non-linear data structure? a) Linked List b) Queue c)
Stack d) Tree ✅
2. Which sorting algorithm does NOT use recursion? a) Quick Sort b) Merge Sort c) Insertion Sort ✅
d) Heap Sort
3. Which of the following operations is common to both linear and binary search? a) Sorting the data
before searching b) Comparing elements ✅ c) Splitting the data into two halves d) Reversing the
data
4. What is the best sorting algorithm to use when stability is a requirement? a) Quick Sort b) Merge
Sort ✅ c) Heap Sort d) Shell Sort
5. Which classification of sorting algorithms involves comparing elements to one another? a) By
Recursion b) By Memory Usage c) By Number of Comparisons ✅ d) By Stability

II. True or False Statements

1. A binary search can be used on unsorted data. ❌ False (Binary search requires sorted data.)
2. Merge Sort is both a stable and recursive sorting algorithm. ✅ True
3. Arrays and linked lists are examples of non-linear data structures. ❌ False (They are linear data
structures.)
4. The number of swaps is a classification criterion for sorting algorithms. ✅ True
5. Time complexity measures the amount of memory an algorithm uses during execution. ❌ False
(Time complexity measures execution time, not memory usage.)

Practical Assessment

1. Managing Shipments Using a Stack

Algorithm Using a Stack

plaintext
BEGIN
DEFINE shipmentStack as an empty stack
FUNCTION push(shipment):
Add shipment to the top of shipmentStack

FUNCTION pop():
If shipmentStack is not empty:
Remove and return the top shipment
Else:
Print "No shipments to undo"
FUNCTION top():
If shipmentStack is not empty:
Return the top shipment without removing it
Else:
Print "No shipments available"
END

Explanation:

 push(shipment) adds a new shipment.


 pop() removes the last added shipment (undo operation).
 top() checks the most recent shipment in the stack.

2. Sorting Furniture Categories

Algorithm Using Merge Sort

plaintext
BEGIN
FUNCTION mergeSort(arr):
IF size of arr <= 1:
RETURN arr
Divide arr into two halves
Recursively apply mergeSort to each half
Merge the sorted halves back together
RETURN sorted list
END

Why Merge Sort?

 Stable sorting: Maintains order of identical elements.


 Efficient for large datasets: O(n log n) time complexity.
 Optimal for categorizing furniture in daily reports.

3. Using Linked List for Warehouse Management

Algorithm Using a Linked List

plaintext
BEGIN
DEFINE Node as a structure containing:
FurnitureItem
Pointer to next node

FUNCTION addItem(item):
Create a new node with item
Add node to the end of the linked list

FUNCTION removeItem(item):
Find node containing item
If found, remove it from linked list

FUNCTION traverseList():
Start from head node
Loop through linked list, printing each item
END

How Linked List Supports Operations?

 Dynamic allocation: Easily add and remove items as shipments vary daily.
 Efficient traversal: Loop through the list to generate reports.

Written Assessment

I. True or False Statements

1. The bubble sort algorithm is generally faster than quick sort for large datasets. ❌ False (Quick sort is
generally faster for large datasets due to its average-case time complexity of O(n log n) compared to
bubble sort's O(n²).)
2. Arrays and linked lists are both linear data structures. ✅ True
3. Binary search can be performed on both sorted and unsorted arrays. ❌ False (Binary search requires
a sorted array.)
4. Benchmark.js and jsPerf are tools used for testing and measuring the performance of JavaScript
code. ✅ True
5. Profiling and benchmarking tools like Benchmark.js and jsPerf help evaluate the performance of
JavaScript code. ✅ True

II. Multiple Choice Questions

1. Which of the following environments can be used to run JavaScript source code? a) Browser
Developer Tools b) IDE Terminal c) Text Editor d) Both a and b ✅
2. Which of the following is a linear data structure? a) Graph b) Tree c) Linked List ✅ d) Hash Table
3. Which sorting algorithm generally has better average performance on large datasets? a) Bubble Sort
b) Quick Sort ✅ c) Insertion Sort d) Selection Sort
4. When can binary search be used? a) On unsorted data b) On sorted data ✅ c) On linked lists only d)
On any data structure
5. Which of the following tools is commonly used to profile and measure JavaScript performance? a)
Chrome DevTools b) jsPerf c) Benchmark.js d) All of the above ✅

Practical Assessment: JavaScript Solutions

I. Managing Shipments Using a Stack

JavaScript Code Using a Stack

javascript
class ShipmentStack {
constructor() {
this.stack = [];
}

push(shipment) {
this.stack.push(shipment);
console.log(`Shipment added: ${shipment}`);
}
pop() {
if (this.stack.length === 0) {
console.log("No shipments to undo.");
return;
}
let removed = this.stack.pop();
console.log(`Undo last operation, removed shipment: ${removed}`);
}

top() {
if (this.stack.length === 0) {
console.log("No shipments available.");
return;
}
console.log(`Top shipment: ${this.stack[this.stack.length - 1]}`);
}
}

// Example usage
const manager = new ShipmentStack();
manager.push("Shipment 1");
manager.push("Shipment 2");
manager.top();
manager.pop();
manager.top();

II. Sorting Furniture Categories

JavaScript Code Using Merge Sort

javascript
function mergeSort(arr) {
if (arr.length <= 1) {
return arr;
}

let mid = Math.floor(arr.length / 2);


let left = mergeSort(arr.slice(0, mid));
let right = mergeSort(arr.slice(mid));

return merge(left, right);


}

function merge(left, right) {


let sortedArray = [];
while (left.length && right.length) {
if (left[0] < right[0]) {
sortedArray.push(left.shift());
} else {
sortedArray.push(right.shift());
}
}
return sortedArray.concat(left, right);
}
// Example usage
let furniture = ["Tables", "Chairs", "Beds", "Dressers"];
console.log("Sorted categories:", mergeSort(furniture));

Why Merge Sort?

 Stable Sorting: Maintains order of identical elements.


 Efficient for larger datasets: O(n log n) complexity.
 Ideal for daily warehouse reports.

III. Using Linked List for Warehouse Management

JavaScript Code Using a Linked List

javascript
class Node {
constructor(item) {
this.item = item;
this.next = null;
}
}

class LinkedList {
constructor() {
this.head = null;
}

addItem(item) {
let newNode = new Node(item);
if (!this.head) {
this.head = newNode;
} else {
let temp = this.head;
while (temp.next) {
temp = temp.next;
}
temp.next = newNode;
}
console.log(`Added: ${item}`);
}

removeItem(item) {
if (!this.head) {
console.log("Warehouse is empty.");
return;
}

if (this.head.item === item) {


this.head = this.head.next;
console.log(`Removed: ${item}`);
return;
}

let temp = this.head;


while (temp.next && temp.next.item !== item) {
temp = temp.next;
}

if (temp.next) {
temp.next = temp.next.next;
console.log(`Removed: ${item}`);
} else {
console.log(`${item} not found.`);
}
}

traverseList() {
let temp = this.head;
console.log("Warehouse Inventory:");
while (temp) {
console.log(temp.item);
temp = temp.next;
}
}
}

// Example usage
let warehouse = new LinkedList();
warehouse.addItem("Table");
warehouse.addItem("Chair");
warehouse.addItem("Bed");
warehouse.traverseList();
warehouse.removeItem("Chair");
warehouse.traverseList();

How Linked List Supports Operations?

 Dynamic allocation: Easily add and remove items as shipments vary daily.
 Efficient traversal: Loop through the list to generate reports.

JavaScript
JavaScript and Web Development Assessment

Written Assessment
1. Multiple Choice Questions
i) JavaScript is a _______________ language.
a) Object-Oriented
b) High-level
c) Assembly-language
d) Object-Based
Correct answer: a) Object-Oriented
Explanation: Modern JavaScript supports object-oriented programming paradigms, including class syntax, making
"Object-Oriented" the most accurate broad description. While JavaScript has prototype-based features and can be
considered Object-Based, the contemporary view aligns more with object-oriented programming.
ii) Initialization of variables can be done by writing—________________ operator in between variable name
and operand value.
a) EQUALS
b) =
c) VALUE
d) ==
Correct answer: b) =
Explanation: The assignment operator in JavaScript is the single equals sign (=).

iii) Which of the following keywords is used to define a variable in JavaScript?


a) var
b) let
c) Both A and B
d) None of the above
Correct answer: c) Both A and B
Explanation: Both var and let are used to declare variables in JavaScript. const is also used for constants.

2. Enumerate Five JavaScript Data Types


 String (e.g., "hello", 'world')
 Number (e.g., 10, 3.14, -5)
 Boolean (e.g., true, false)
 Object (e.g., { key: "value" }, [1, 2, 3])
 Undefined (Variable declared but not assigned a value)
(Additional types: Null, Symbol, BigInt)

3. True/False Statements
i) Variable Scope determines the accessibility (visibility) of variables.
Answer: True
ii) A variable stores the data value that can be changed later.
Answer: True
iii) Any variable declared inside a block such as a function can be accessed anywhere in a program.
Answer: False

4. Match the Items


Column A Column B Exp

1. Variable scope D. determines the accessibility (visibility) of variable

2. Vue A. is a JavaScript framework for building user interfaces

3. Global variables B. can be accessed from anywhere in a JavaScript program


Column A Column B Exp

4. Runtime environment C. is literally just where your application is running in

5. Complete the statement


“In JavaScript, an operator is a sign or a special symbol used to perform operations on operands.”
Answer: operator

6. Output of JavaScript Statements


a) result = '4' - 2;
Output: 2
b) result = 'hello' - 'world';
Output: NaN
c) result = 4 + true;
Output: 5
d) result = 4 - undefined;
Output: NaN
e) result = Number('324');
Output: 324
f)

Copy let text = "Hello";

text += " World";

document.write("MY TEXT is " + text);

Output: MY TEXT is Hello World


g)

Copy let x = 10;

x += 5;

document.getElementById("demo").innerHTML = "Value of x is: " + x;

Output: Value of x is: 15 (on webpage)


h)

Copy let x = 5;

console.log('--x = ', --x);

Output: --x = 4
i)

Copy let x = 5;

document.getElementById("demo").innerHTML = (x !== 5);

Output: false
j)

Copy let a = 6;

let b = 14;

result = a & b;

window.alert(result);

Explanation: Bitwise AND of 6 (0110) and 14 (1110) yields 6.


Output: 6

Practical Assessment: Simple Calculator (HTML & JavaScript)


Outline:
 Create input fields for numbers.
 Add buttons for operations (+, -, *, /).
 Display the result in an element.

Sample Implementation:

Copy <!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Simple Calculator</title>

<style>

body { font-family: Arial, sans-serif; text-align: center; }

.calculator { margin: 50px auto; width: 300px; padding: 20px; border: 1px
solid #ccc; border-radius: 8px; }

input { width: 100%; padding: 8px; margin-bottom: 10px; }

button { padding: 10px 20px; margin: 5px; }

#result { margin-top: 20px; font-weight: bold; }


</style>

</head>

<body>

<div class="calculator">

<h2>Calculator</h2>

<input type="number" id="num1" placeholder="Enter first number" />

<input type="number" id="num2" placeholder="Enter second number" />

<div>

<button onclick="calculate('+')">Add</button>

<button onclick="calculate('-')">Subtract</button>

<button onclick="calculate('*')">Multiply</button>

<button onclick="calculate('/')">Divide</button>

</div>

<div id="result"></div>

</div>

<script>

function calculate(operator) {

const n1 = parseFloat(document.getElementById('num1').value);

const n2 = parseFloat(document.getElementById('num2').value);

let result;

if (isNaN(n1) || isNaN(n2)) {

document.getElementById('result').innerText = 'Please enter valid


numbers.';

return;

switch(operator) {

case '+': result = n1 + n2; break;

case '-': result = n1 - n2; break;

case '*': result = n1 * n2; break;

case '/':

if (n2 === 0) {
result = 'Cannot divide by zero.';

} else {

result = n1 / n2;

break;

document.getElementById('result').innerText = 'Result: ' + result;

</script>

</body>

</html>

Additional Content
Additional Theoretical Questions
a) Regular Expressions in JavaScript:
 Strings can be written with ' ', " ", or ` (backticks).
Answer: True
 Named function definitions do not execute automatically upon definition.
Answer: False
 The * quantifier matches zero or more of the preceding element.
Answer: True

b) Example Code Snippet:

Copy var a = 1;

if (a > 10) {

document.write(10);

} else {

document.write(a);

Output: 1

c) Object Example:

Copy var mango = new Object();


mango.color = "yellow";

mango.price = 200;

mango.sweetness = 8;

mango.howSweetAmI = function() {

document.write("Good Fruit");

};

document.write("color: " + mango.color);

document.write(" price: " + mango.price);

mango.howSweetAmI();

Output:
color: yellow price: 200
Good Fruit

d) Match the functions:


Function Description

1. setTimeout() B. Calls function after delay in milliseconds

2. setInterval() A. Calls function repeatedly after each duration

3. clearTimeout() C. Clears the timeout set by setTimeout()

Answer: 1️ → B, 2️ → A, 3️ → C

Additional Practical: Pattern Printing


Task: Use JavaScript to print the following pattern:

Copy*

* *

* * *

* * * *

* * * * *

Sample Code:

Copy for (let i = 1; i <= 5; i++) {

let pattern = "";


for (let j = 1; j <= i; j++) {

pattern += "* ";

console.log(pattern.trim());

Design User Interface UI x Ux

Theoretical Assessment

I. Circle the letter corresponding to the best answer:

1. UX is: A. User xampp B. User unknown C. User experience


o Correct Answer: C
2. UI is: A. User Internet B. User Intermediate C. User Interface
o Correct Answer: C
3. Which of the following is a step in UX analysis? A. Identification of user issues B. Creation of marketing
strategies C. Budget planning D. Hiring new staff
o Correct Answer: A (UX analysis focuses on understanding user needs, behaviors, and problems,
which includes identifying issues they face).
4. Which type of brand competition involves companies offering similar products to the same target market?
A. Indirect Competition B. Replacement Competition C. Direct Competition D. Strategic Competition
o Correct Answer: C (Direct competition is when businesses offer similar products or services to
the same customer base).
5. Choose the correct answer of Steps of UI/UX Design Process: a) Product definition, Design b) Design,
Research, Product definition c) Product definition, Research, Analysis, Design, Validation
o Correct Answer: C (While processes can vary, a common and comprehensive flow includes
understanding the product, researching users and market, analyzing findings, designing solutions,
and validating them with users).

II. According to the bellow statement answer by True or False

a. Three Levels of Pain Points are plan, observation and Relationship. * Answer: False (While "observation" might
be part of identifying pain points, "plan" and "Relationship" are not standard, widely recognized "Levels of Pain
Points". Pain points are typically categorized based on where they occur in the user journey or what type of problem
they represent, e.g., financial, productivity, support pain points).

b. Pain points are problems that occur at the different levels of the customer experience. * Answer: True (Pain
points are indeed issues or problems that a customer or user experiences at various stages of their journey or
interaction with a product, service, or brand).

Practical Assessment

I understand the scope of the practical task involves:

1. Designing a Homepage with search, featured recipes, categories, and login/signup.


2. Designing a Recipe Listing Page with a grid layout, recipe cards, and sorting/filtering options.
3. Designing a Recipe Detail Page with image, name, description, time, ingredients, instructions, and reviews.
4.
5. Designing a User Profile Page with user info, uploaded recipes, edit/delete options, and favourites.
6. Designing an Upload Recipe Page with a form and image upload.
7. Creating a low-fidelity wireframe to show structure and layout.
8. Developing a low-fidelity prototype to show interaction between features.
9. Using tools like Figma, Trello, or Adobe XD, and standard office equipment/materials.

While I can understand and process these requirements, please remember that I am a text-based AI and cannot
actually perform the visual design tasks of creating wireframes or interactive prototypes in tools like Figma or
Adobe XD.

Written assessment

Q1. Answer true or false to the following statements:

a) Step of UX designer’s journey are five. * Answer: False (The "steps of a UX designer's journey" isn't a
universally fixed number like five. A UX designer's activities and process involve various stages, often iterative, like
research, analysis, design, testing, implementation, etc., and the specific process can vary depending on
methodology and project).

b) User journey help user to interacts with a product and allows designers to see a product from a user’s point of
view. * Answer: True (A user journey map is a visualization tool that helps designers understand the steps a user
takes to interact with a product or service, explicitly allowing the designer to adopt the user's perspective, emotions,
and pain points throughout that experience).

c) User story and user scenario are not important during design process. * Answer: False (User stories and user
scenarios are fundamental tools in the design process. User stories capture user needs from their perspective, while
user scenarios describe specific situations in which a user interacts with the product. Both are crucial for defining
features, understanding context, and designing solutions that meet real user needs).

Q2. Complete the following sentences with the following word: creative brief, user personas, story.

a) The written definition of a UX Designer’s first visualization of the first wireframes and prototypes is story. *
(Note: This sentence is phrased somewhat unusually. A "user story" defines a user's need/goal, which informs
wireframes/prototypes. A "creative brief" outlines the project strategy. "User personas" represent the target users. If
the blank refers to a narrative that informs the initial design visualization based on a user's need, "story" (as in user
story or scenario) fits best among the options, but it's not a standard definition of the visualization itself).

b) creative brief is a document used to outline the strategy of a creative project? * Answer: creative brief

Practical assessment

Thank you for outlining the scenario and the steps involved in the practical assessment for improving the e-
commerce camping gear website for outdoor enthusiasts.

I understand the tasks described are:

 Creating a user persona for an outdoor enthusiast.


 Generating at least three user stories based on that persona.
 Developing a user journey map for one of the user stories, focusing on the purchase flow.
 Presenting and explaining these deliverables.
Theoretical assessment

I. Circle the correct answer

1. Which of the following is a type of user interface that uses visual elements like windows, icons, and
buttons? a) Command Line Interface (CLI) b) Graphical User Interface (GUI) c) Menu-driven User
Interface d) Voice User Interface (VUI)
o Correct Answer: b) Graphical User Interface (GUI)
2. Which user interface involves interaction through typing text commands? a) Graphical User Interface
(GUI) b) Command Line Interface (CLI) c) Touch User Interface d) Natural Language User Interface
o Correct Answer: b) Command Line Interface (CLI)
3. Which factor is NOT part of Peter Morville's User Experience Honeycomb? a) Useful b) Credible c)
Expensive d) Findable
o Correct Answer: c) Expensive (Morville's honeycomb includes Useful, Usable, Desirable,
Findable, Accessible, Credible, and Valuable).
4. What is the purpose of a creative brief in a project? a) To outline the strategy of a creative project b) To
create user personas c) To define budget planning d) To hire new staff
o Correct Answer: a) To outline the strategy of a creative project
5. What is the primary goal of usability in UI/UX design? a) To attract new users b) To ensure the product is
easy to use c) To create a visually appealing design d) To reduce development costs
o Correct Answer: b) To ensure the product is easy to use (Usability specifically focuses on the
effectiveness, efficiency, and satisfaction of users when interacting with a product).
6. Which of the following is a characteristic of a high-fidelity wireframe? a) Sketches on paper b) Detailed
and may include simple workflows and interactions c) Basic outline without much detail d) Only
includes text and no visual elements
o Correct Answer: b) Detailed and may include simple workflows and interactions (High-fidelity
wireframes are much more refined than low-fidelity ones, often created digitally and including
more detail, realistic spacing, and sometimes basic interactions).
7. A mockup typically includes all the following visual details EXCEPT: a) Colors, styles, graphics, and
typography b) Styled buttons and text c) Navigation graphics d) User interaction feedback
o Correct Answer: d) User interaction feedback (Mockups are static visual representations. User
interaction feedback (like how a button changes when clicked or an error message appears) is
demonstrated in prototypes, not mockups).
8. What is the primary goal of a prototype? a) To outline the basic structure of a page b) To test and validate
ideas before final development c) To create a static model of the page d) To organize information within
digital products
o Correct Answer: b) To test and validate ideas before final development (Prototypes allow
designers to simulate user flows and interactions to gather feedback and validate design decisions
before investing heavily in development).
9. What does the 3-click rule suggest? a) Users should receive feedback within 3 seconds b) No page should
take more than 3 clicks to access c) Usability tests should be completed in 3 stages d) Every page must
have at least 3 clickable links
o Correct Answer: b) No page should take more than 3 clicks to access (The 3-click rule is a
debated, but still referenced, guideline suggesting that users should be able to find the information
or complete the task they are looking for on a website within three clicks).
10. Answer by true if a statement is correct and false if is wrong a) In the UX design process, the analysis
phase involves creating user personas. * Answer: True (Creating user personas is typically done during the
analysis phase, after user research, as it involves synthesizing research data to represent target user types).
b) A prototype is an interactive simulation of a product designed to test the user experience. * Answer:
True (This is an accurate description of a prototype's purpose and nature in UX design).

Practical assessment
Thank you for outlining the scenario for the ABC CO MIS project. I understand the goal is to create a mockup and
prototype for a web application to manage student competition applications, including user authentication, student
application submission, administrator review/decision making, and student status checking. I also understand the
emphasis on ease of use and consistency, the suggested tool (Figma), and the time allocation (8 hours).

As with the previous practical scenario, I am a text-based AI and cannot physically create the visual mockup or
the interactive prototype using tools like Figma.

Okay, let's outline the typical steps a UX designer would take to create a mockup and prototype for the ABC CO
MIS project, based on the requirements you provided and considering the suggested tools and time frame.

Here are the steps you would follow:

Step 1: Understand the Core Requirements & Users (approx. 30-60 minutes)

 Review: Re-read the project description and required functionality:


o User Authentication (all users)
o Student Application Submission
o Administrator Application Review & Decision (Accept/Reject)
o Student Status Check
o Emphasis on ease of use and consistency.
 Identify Key User Flows: Define the main paths users (Students and Administrators) will take through the
system.
o Student Flow: Land on site -> Authenticate -> Find application form -> Fill and submit form ->
Check status later.
o Administrator Flow: Land on site -> Authenticate -> View list of applications -> View details of
an application -> Make a decision (Accept/Reject) -> (Potentially) Notify student (though the
notification mechanism isn't detailed, the decision itself is a key action).
 Identify Key Screens: List the essential pages needed to support these flows.
o Login/Authentication Page
o Student Dashboard/Homepage (where they can start an application or check status)
o Student Application Form Page(s)
o Student Application Status Page
o Administrator Dashboard (where they see a list of applications)
o Administrator Application Detail/Review Page
o (Potentially) Registration Page (if new users need to sign up before authentication)

Step 2: Initial Sketching / Low-Fidelity Wireframing (approx. 60-90 minutes)

 Tool: Use papers, pens, and pencils.


 Process: Quickly sketch the basic layout and main elements for each of the key screens identified in Step 1.
Don't focus on details or visual design yet. The goal is to block out where content, forms, buttons, etc., will
go.
 Focus: Think about the hierarchy of information and how users will navigate between screens.

Step 3: Create Mid-to High-Fidelity Mockups (in Figma) (approx. 3-4 hours)

 Tool: Figma.
 Process: Translate your sketches into digital mockups in Figma.
o Set up: Create a new Figma project. Define a basic color palette (even if just grayscale or a few
main colors) and typography (basic font styles).
o Design Screens: Design each of the key screens.
 Layout: Implement the layout from your sketches.
 UI Elements: Add standard UI components like input fields, buttons, dropdowns, tables
(for application lists), headers, footers, navigation. Use consistent styling for these
elements.
 Content: Include representative text (even if placeholder like "Lorem Ipsum") and labels
for fields. For the Admin view, show examples of application data in a table.
 Visual Details: Add more visual detail than sketches – use colors, specific fonts, spacing,
and ensure elements are aligned and consistent across pages. This is where you make it
look like a static representation of the final UI.
 Focus: Consistency in layout, styling, and element usage. Ensure all necessary information and interaction
points (buttons, forms) are present on each screen according to the flows.

Step 4: Build the Interactive Prototype (in Figma) (approx. 1.5-2 hours)

 Tool: Figma's Prototyping feature.


 Process: Connect the screens you designed in the mockup phase to simulate the user flows.
o Connect Interactions: Link clickable elements (like buttons, list items, submit buttons) on one
screen to the target screen they lead to.
o Define Transitions: Choose how screens transition (e.g., instant, slide in).
o Implement Key Flows: Focus on making the main user flows (Student application, Admin
review, Student status check) navigable. Make the buttons and elements involved in these core
tasks interactive. You might add simple feedback like a confirmation message after submitting a
form.
 Focus: Ensuring the prototype accurately reflects the intended user journeys and allows users (or the
presenter) to click through the main tasks.

Step 5: Review and Refine (On-going & Wrap-up - approx. 30-60 minutes)

 Review: Click through your prototype yourself to ensure connections work and flows make sense. Look for
any inconsistencies in the mockups.
 Refine: Make adjustments to the mockups or prototype connections as needed.
 Prepare for Presentation: Organize your Figma file. Be ready to explain your design choices, the user
flows you've enabled in the prototype, and how the design addresses the project requirements for both
students and administrators, emphasizing ease of use and consistency.

Vue Js

Written Assessment: Vue.js and Web Development Basics

I. Multiple Choice Questions

1. Which term refers to the client-side of a web application, which is what users interact with directly in
their web browsers? A) Frontend ✅
2. Select the best term that defines a Single Page Application (SPA): A) A web application that loads a
single HTML page and dynamically updates it as the user interacts with the app ✅
3. Which command can be used to check the version of Node.js and npm installed on your computer?
A) node -v ✅ (For Node.js) C) npm -v ✅ (For npm)
4. How can you install Vue.js in your project? A) npm install vue ✅
5. Which of the following are necessary steps to run a simple JavaScript program that can add two
numbers using Node.js?? E) All of the above ✅
6. Suppose you want to create a game project named "snake game." Which command can be used to
create the project? C) vue create snake-game ✅
7. CLI stands for: a) Command Line Interface ✅
8. Which of the following is NOT a common feature of an IDE? d) Web browser ✅
9. The frontend of a web application primarily deals with: c) User interface and presentation ✅
10. In a Single Page Application (SPA): a) The entire application runs on a single HTML page. ✅
11. Vue.js is primarily a: b) Frontend framework ✅

II. Matching Vue.js Project Files

File/Folder Description
a. src iii Main folder for source code
b. components ii Stores reusable Vue components
c. node_modules vi Installed packages and dependencies
d. App.vue iv Entry point component of a Vue.js application
e. package.json i Contains metadata about the project and dependencies
f. .gitignore v Ignored files and directories for version control

III. True or False Statements

1. A framework provides a structured and reusable foundation for building applications. ✅ True
2. The cd command is used to create a new directory in the Command Prompt. ❌ False (It is used to
change directories.)
3. IDEs typically include a code editor, build tools, and debugging capabilities. ✅ True
4. The Vue.js framework is primarily used for backend development. ❌ False (Vue.js is a frontend
framework.)
5. Single Page Applications (SPAs) require page reloads for every user action. ❌ False (SPAs update
dynamically without reloading.)
6. The virtual DOM is a real-time representation of the browser's DOM. ❌ False (The virtual DOM is
an optimized in-memory representation.)
7. Vue.js follows a component-based architecture. ✅ True
8. The del command is used to list files and directories in the Command Prompt. ❌ False (It is used to
delete files.)
9. A dependency in Vue.js refers to an external library or module required by your project. ✅ True
10. The mkdir command is used to change the current directory in the Command Prompt. ❌ False (It is
used to create a new directory.)

Practical Assessment: Creating the Game Project Using Vue.js

To initialize a Vue.js project for the XYZ Rwandan Museum, follow these steps:

1. Install Vue CLI (if not already installed)

bash
npm install -g @vue/cli

2. Create the Vue project

bash
vue create rwanda-museum-game

3. Navigate into the project folder

bash
cd rwanda-museum-game

4. Start the development server

bash
npm run serve

Displaying "Welcome to Rwanda Museum" on the Main Interface

Modify the App.vue file:

vue
<template>
<div class="welcome-container">
<h1>Welcome to Rwanda Museum</h1>
<p>Explore the rich history of Rwanda through interactive
storytelling.</p>
</div>
</template>

<script>
export default {
name: "App"
};
</script>

<style>
.welcome-container {
text-align: center;
margin-top: 100px;
}

h1 {
font-size: 36px;
color: #2c3e50;
}

p {
font-size: 20px;
color: #34495e;
}
</style>

Why Vue.js for This Project?

 Interactive UI: Vue allows real-time user interactions.


 Component-Based Design: Reusable components for managing different historical figures.
 Responsive Design: Works seamlessly across devices.
I. Multiple Choice Questions with Answers

1. What is Vue.js?? B) A JavaScript framework for building user interfaces ✅


2. Which directive is used for two-way data binding in Vue.js?? A) v-model ✅
3. How do you create a new Vue instance? A) new Vue() ✅
4. What is the purpose of the v-for directive in Vue.js?? C) List rendering ✅
5. Which lifecycle hook is called after the Vue instance has been mounted to the DOM? B) mounted ✅
6. How can you communicate between parent and child components in Vue.js?? D) Both A and C
(Props and Slots) ✅
7. What does the v-bind directive do in Vue.js?? B) Binds an attribute to an expression ✅
8. Which Vue.js feature allows you to transition between elements when they are inserted or removed
from the DOM? B) v-transition ✅
9. What is the purpose of the v-if directive in Vue.js?? A) Conditional rendering ✅
10. How can you include external libraries or plugins in a Vue.js project? C) Both A and B (Using
<script> tag or import statement) ✅
11. What is the role of Vuex in Vue.js?? B) State management ✅
12. Which of the following is the correct way to bind a class dynamically based on a condition in
Vue.js?? B) v-bind:class ✅
13. How can you handle user input in Vue.js?? A) Using the v-model directive ✅
14. What does the v-show directive do in Vue.js?? B) Toggles the visibility of an element based on a
condition ✅
15. How can you optimize performance in a Vue.js application? D) All of the above (Using computed
properties, v-if instead of v-show, key attributes in v-for loops) ✅
16. What is the purpose of the v-on directive in Vue.js?? B) Event handling ✅
17. Which Vue.js feature allows you to reuse content across different components? D) Components ✅
18. What is the purpose of the v-model directive in Vue.js?? C) Implement two-way data binding on
form elements ✅
19. In Vue.js, what does the nextTick method do? C) Executes a function after the DOM has been
updated ✅
20. Which Vue.js lifecycle hook is called when a component is about to be destroyed? B) beforeDestroy

Practical Assessment: Developing the Frontend for UBUMWE Hotel

Project Structure for Vue.js Application

plaintext
ubumwe-hotel/
│── src/
│ ├── components/ # Contains reusable UI components
│ ├── views/ # Contains page components (Home, About, etc.)
│ ├── router/ # Vue Router setup
│ ├── store/ # Vuex store for state management
│ ├── assets/ # Images, fonts, and styles
│ ├── App.vue # Main application component
│ ├── main.js # Entry point for Vue app
│── public/
│ ├── index.html # Main HTML file
│── package.json # Project dependencies
│── README.md # Documentation
Setting Up the Vue Project

bash
# Install Vue CLI (if not installed)
npm install -g @vue/cli

# Create a new Vue project


vue create ubumwe-hotel

# Navigate into the project directory


cd ubumwe-hotel

# Install Vue Router for navigation


npm install vue-router

# Install Axios for API integration


npm install axios

# Install Vuex for state management


npm install vuex

# Start the development server


npm run serve

Navigation and Routing Setup (router/index.js)

javascript
import { createRouter, createWebHistory } from 'vue-router';
import Home from '../views/Home.vue';
import About from '../views/About.vue';
import Contact from '../views/Contact.vue';
import Registration from '../views/Registration.vue';
import NotFound from '../views/NotFound.vue';

const routes = [
{ path: '/', component: Home },
{ path: '/about', component: About },
{ path: '/contact', component: Contact },
{ path: '/registration', component: Registration },
{ path: '/:pathMatch(.*)*', component: NotFound } // 404 Page
];

const router = createRouter({


history: createWebHistory(),
routes
});

export default router;

Simple Registration Form (views/Registration.vue)

vue
<template>
<div>
<h2>Register a Room</h2>
<form @submit.prevent="registerRoom">
<input type="text" v-model="roomType" placeholder="Room Type">
<input type="text" v-model="guestName" placeholder="Guest Name">
<button type="submit">Register</button>
</form>

<h3>Registered Rooms</h3>
<table>
<tr>
<th>Room Type</th>
<th>Guest Name</th>
</tr>
<tr v-for="room in rooms" :key="room.id">
<td>{{ room.roomType }}</td>
<td>{{ room.guestName }}</td>
</tr>
</table>
</div>
</template>

<script>
export default {
data() {
return {
roomType: '',
guestName: '',
rooms: []
};
},
methods: {
registerRoom() {
this.rooms.push({ id: this.rooms.length + 1, roomType: this.roomType,
guestName: this.guestName });
this.roomType = '';
this.guestName = '';
}
}
};
</script>

Fetching Data from API Using Axios (views/Home.vue)

vue
<template>
<div>
<h2>Hotel Services</h2>
<ul>
<li v-for="service in services" :key="service.id">{{ service.name
}}</li>
</ul>
</div>
</template>

<script>
import axios from 'axios';
export default {
data() {
return {
services: []
};
},
async mounted() {
try {
const response = await axios.get('https://api.example.com/hotel-
services');
this.services = response.data;
} catch (error) {
console.error("Error fetching data:", error);
}
}
};
</script>

State Management Using Vuex (store/index.js)

javascript
import { createStore } from 'vuex';

const store = createStore({


state: {
rooms: []
},
mutations: {
registerRoom(state, payload) {
state.rooms.push(payload);
}
},
actions: {
registerRoom({ commit }, room) {
commit('registerRoom', room);
}
},
getters: {
getRooms(state) {
return state.rooms;
}
}
});

export default store;

Key Features in the Application

✅ Routing: Seamless navigation between pages using Vue Router ✅ State Management: Efficient management
of registration data using Vuex ✅ API Integration: Fetching and displaying dynamic data using Axios ✅ Error
Handling: 404 page to catch invalid routes
Written Assessment: Game Development & Vue.js
I. Multiple Choice Questions with Answers

1. What contributes to making a good character in games? A) Visual Appeal, Personality and
Backstory, Character Arc and Growth, Voice Acting and Dialogue ✅
2. Personality and Backstory are important elements in creating compelling characters for game
narratives. ✅ True
3. Voice acting is not necessary for engaging characters in video games. ❌ False (Voice acting enhances
character immersion and emotional impact.)
4. What are examples of alert messages commonly found in digital interfaces? B) Success Messages,
Failure Messages, Information Messages, Warning Messages ✅
5. Alert messages are used in applications solely for decorative purposes. ❌ False (They provide
important feedback and guidance to users.)
6. Warning messages are used to notify users of potential issues. ✅ True
7. Which types of keyboard inputs are commonly used in Vue.js games? B) Keyboard Input, Mouse
Input, Touch Input (for mobile devices), Game Controller Input ✅
8. Mouse Input is typically used in Vue.js games to control gameplay elements. ✅ True
9. Game Controller Input is only used for console games and not for web-based games developed with
Vue.js.. ❌ False (Game controllers can be integrated into web-based games.)
10. What are the essential elements that define a game? A) Scores, Level, Speed, Time, Target Device ✅
11. Speed is not an essential element in defining a game. ❌ False (Speed affects difficulty and player
experience.)
12. The target device can impact the design and mechanics of a game. ✅ True
13. What is the purpose of the Game HUD in video games? A) To display essential information,
feedback, and interactive elements during gameplay ✅
14. The Game HUD is only used in first-person shooter games. ❌ False (HUDs are used across various
game genres.)
15. HUD elements include health bars, score displays, and mini-maps. ✅ True
16. What are key aspects that make up game environments? A) Landscapes and Terrain, Architecture
and Structures, Natural Elements, Props and Objects ✅
17. Game environments do not affect the player's immersion. ❌ False (Environments significantly impact
immersion.)
18. Natural elements like trees and rivers contribute to the game's atmosphere. ✅ True
19. What are the steps to download and prepare different game sounds? A) Identify Sound
Requirements, Search for Sound Resources, Download Sound Assets, Organize Sound Files,
Optimize Sound Quality, Create Sound Variations ✅
20. Organizing sound files is an unnecessary step in preparing game sounds. ❌ False (Proper organization
ensures efficiency in game development.)
21. Creating sound variations can enhance the audio experience in a game. ✅ True
22. What are the essential steps to create a storyline? A) Identify the Central Theme, Develop
Characters, Outline the Plot, Establish Setting, Write Dialogue ✅
23. Establishing a setting is not important when creating a storyline. ❌ False (Setting provides context
and enhances the narrative.)
24. Writing dialogue helps in character development and advancing the plot. ✅ True
25. What role does the central theme play in a storyline? A) It serves as the foundation and guiding
concept for the narrative ✅
26. A well-developed character arc is crucial for player engagement. ✅ True
27. Game controller input is less responsive than keyboard input in Vue.js games. ❌ False
(Responsiveness depends on implementation.)
28. Information messages in applications provide users with general updates or instructions. ✅ True
29. Props and objects in game environments have no impact on gameplay mechanics. ❌ False (They
interact with gameplay mechanics.)
30. Speed adjustments in games can influence the difficulty level and player experience. ✅ True

Practical Assessment: Storyline for the Game Development Team


Game Title: "Leap to Victory"
Concept:

A lone traveler embarks on an endless journey across a vast, mysterious plain. Along the way, obstacles rise from
the ground—fallen logs, crumbling rocks, and ancient ruins. To survive, the traveler must jump over each obstacle,
gaining speed and points with every successful leap.

Main Character:

 Name: Akimana
 Background: A young explorer seeking the legendary Lost City, rumored to be hidden beyond a
treacherous landscape.
 Abilities: Quick reflexes, controlled jumps, and stamina boosts.

Game Mechanics:

 Movement: Players control Akimana using arrow keys or touch input to move forward and jump over
obstacles.
 Obstacles: Randomly generated logs, rocks, water pits, and fallen branches.
 Scoring: Points increase with each successful jump; missing an obstacle decreases stamina.
 Power-ups: Collect speed boosters and shield power-ups to avoid obstacles.

HUD Display:

 Score Counter: Tracks the number of successful jumps.


 Speed Meter: Displays the character’s running speed.
 Obstacle Indicator: Warns players of upcoming obstacles.

Sound Effects and Music:

 Background Music: A mystical adventure soundtrack that increases in intensity as speed grows.
 Jump Sound: A swift leap effect when clearing an obstacle.
 Failure Sound: A falling impact noise when missing an obstacle.
 Victory Sound: An achievement chime for surpassing a difficult sequence.

Game Goal:

Players must keep Akimana moving, avoiding obstacles while unraveling fragments of the Lost City's history. The
longer they survive, the more of the mystery they uncover—bringing them closer to discovering the legendary
civilization.

Here’s some Vue.js code to create a basic jumping game where a character must jump over obstacles.
Setting Up the Vue.js Project

First, install Vue.js (if not already installed):

bash

npm install -g @vue/cli


vue create jumping-game
cd jumping-game
npm run serve
Game Interface (App.vue)
vue

<template>
<div class="game-container">
<h1>Jumping Game</h1>
<div class="game-area">
<div class="character" :class="{ jump: isJumping }"></div>
<div class="obstacle"></div>
</div>
<button @click="startGame">Start Game</button>
<h3>Score: {{ score }}</h3>
</div>
</template>

<script>
export default {
data() {
return {
isJumping: false,
score: 0,
obstaclePosition: 300
};
},
methods: {
startGame() {
setInterval(() => {
this.score++;
this.moveObstacle();
}, 1000);
window.addEventListener("keydown", this.jump);
},
jump() {
this.isJumping = true;
setTimeout(() => {
this.isJumping = false;
}, 500);
},
moveObstacle() {
this.obstaclePosition -= 10;
if (this.obstaclePosition <= 0) this.obstaclePosition = 300;
}
}
};
</script>
<style>
.game-container {
text-align: center;
}
.game-area {
position: relative;
width: 400px;
height: 200px;
background: lightgray;
margin: auto;
overflow: hidden;
}
.character {
width: 50px;
height: 50px;
background: red;
position: absolute;
bottom: 0;
left: 50px;
transition: all 0.5s;
}
.character.jump {
bottom: 100px;
}
.obstacle {
width: 40px;
height: 40px;
background: blue;
position: absolute;
bottom: 0;
left: 300px;
}
</style>
Game Features

✅ Jump Mechanism: Players press a key to make the character jump. ✅ Moving Obstacle: The obstacle moves
toward the character. ✅ Score Counter: Tracks successful jumps. ✅ Styling: Simple animations using CSS.

Would you like additional features such as collision detection or sound effects? 🚀

yes

Great! Let's add collision detection and sound effects to enhance the game.

Updated Vue.js Jumping Game with Collision Detection and Sound Effects

Now, we'll check if the character collides with the obstacle and play sounds when jumping and failing.

Step 1: Add Sound Files

Download or prepare sound effects (jump sound, collision sound) and place them in your project's assets folder:

jump.mp3
collision.mp3
Updated App.vue
vue

<template>
<div class="game-container">
<h1>Jumping Game</h1>
<div class="game-area">
<div class="character" :class="{ jump: isJumping }"></div>
<div class="obstacle" :style="{ left: obstaclePosition + 'px' }"></div>
</div>
<button @click="startGame">Start Game</button>
<h3>Score: {{ score }}</h3>
</div>
</template>

<script>
export default {
data() {
return {
isJumping: false,
score: 0,
obstaclePosition: 300,
gameInterval: null
};
},
methods: {
startGame() {
this.score = 0;
this.obstaclePosition = 300;

this.gameInterval = setInterval(() => {


this.score++;
this.moveObstacle();
this.checkCollision();
}, 100);

window.addEventListener("keydown", this.jump);
},
jump() {
this.isJumping = true;
this.playSound("jump.mp3");
setTimeout(() => {
this.isJumping = false;
}, 500);
},
moveObstacle() {
this.obstaclePosition -= 10;
if (this.obstaclePosition <= 0) this.obstaclePosition = 300;
},
checkCollision() {
if (!this.isJumping && this.obstaclePosition < 100 &&
this.obstaclePosition > 50) {
this.playSound("collision.mp3");
alert("Game Over! Final Score: " + this.score);
clearInterval(this.gameInterval);
}
},
playSound(filename) {
let sound = new Audio(require(`@/assets/${filename}`));
sound.play();
}
}
};
</script>

<style>
.game-container {
text-align: center;
}
.game-area {
position: relative;
width: 400px;
height: 200px;
background: lightgray;
margin: auto;
overflow: hidden;
}
.character {
width: 50px;
height: 50px;
background: red;
position: absolute;
bottom: 0;
left: 50px;
transition: all 0.5s;
}
.character.jump {
bottom: 100px;
}
.obstacle {
width: 40px;
height: 40px;
background: blue;
position: absolute;
bottom: 0;
}
</style>
New Features

✅ Collision Detection: If the character is not jumping when the obstacle reaches its position, the game ends. ✅
Sound Effects: Plays a jump sound when the player jumps and a collision sound when the game ends. ✅ Game
Restart: The game can be restarted without reloading.

Written Assessment: Web Development & Game Design

I. Multiple Choice Questions with Answers

1. Which platform is commonly used for deploying static websites? A) Netlify ✅


2. What does a domain name uniquely identify? B) A website's IP address ✅
3. What does SASS stand for? B) Syntactically Awesome Style Sheets ✅
4. Which HTML5 element is commonly used for dynamic, scriptable rendering of graphics? C)
<canvas> ✅
5. What advantage does SVG offer over traditional image formats like JPEG or PNG? D) All of the
above ✅ (SVG supports animations, has smaller file sizes, and is easily embedded in HTML.)
6. What aspect of game design focuses on the visual representation of the game world? B) Game
interface design ✅
7. Which JavaScript method is used to get the rendering context and drawing functions for a
<canvas> element? A) getContext() ✅
8. Which JavaScript function is used to draw a filled rectangle on a <canvas> element? A) fillRect()

9. How does SASS extend CSS? A) By adding variables, nesting, and mixins ✅
10. What does the HUD in a game typically display? C) Character health, score, and resources ✅

II. Fill in the Blanks

11.

a) Containers for game stats typically include score and health. b) setInterval() in JavaScript is used to
execute a function repeatedly at specified intervals. c) To deploy a game project on Netlify, you need to connect
your project to a GitHub repository.

Practical Assessment: Implementing Scoring & Deploying Vue.js Game on Netlify

1. Implementing Scoring in the Vue.js Jumping Game

vue
<template>
<div class="game-container">
<h1>Jumping Game</h1>
<h3>Score: {{ score }}</h3>
<div class="game-area">
<div class="character" :class="{ jump: isJumping }"></div>
<div class="obstacle" :style="{ left: obstaclePosition + 'px' }"></div>
</div>
<button @click="startGame">Start Game</button>
</div>
</template>

<script>
export default {
data() {
return {
isJumping: false,
score: 0,
obstaclePosition: 300,
gameInterval: null
};
},
methods: {
startGame() {
this.score = 0;
this.obstaclePosition = 300;
this.gameInterval = setInterval(() => {
this.moveObstacle();
this.checkCollision();
}, 100);
window.addEventListener("keydown", this.jump);
},
jump() {
if (!this.isJumping) {
this.isJumping = true;
this.score++; // Increment score when jumping
setTimeout(() => {
this.isJumping = false;
}, 500);
}
},
moveObstacle() {
this.obstaclePosition -= 10;
if (this.obstaclePosition <= 0) this.obstaclePosition = 300;
},
checkCollision() {
if (!this.isJumping && this.obstaclePosition < 100 &&
this.obstaclePosition > 50) {
alert("Game Over! Final Score: " + this.score);
clearInterval(this.gameInterval);
}
}
}
};
</script>

<style>
.game-container {
text-align: center;
}
.game-area {
position: relative;
width: 400px;
height: 200px;
background: lightgray;
margin: auto;
overflow: hidden;
}
.character {
width: 50px;
height: 50px;
background: red;
position: absolute;
bottom: 0;
left: 50px;
transition: all 0.5s;
}
.character.jump {
bottom: 100px;
}
.obstacle {
width: 40px;
height: 40px;
background: blue;
position: absolute;
bottom: 0;
}
</style>

✅ Scoring System Added: Score increments when the player successfully jumps. ✅ Game Over Condition:
Displays the final score when a collision occurs.

2. Deploying Vue.js Game on Netlify

Follow these steps to deploy your Vue.js project to Netlify:

Step 1: Install Netlify CLI (Optional)

bash
npm install -g netlify-cli

Step 2: Build the Vue.js Project

bash
npm run build

This creates a dist folder containing the optimized files for deployment.

Step 3: Connect to GitHub

 Push your project to GitHub.


 Ensure Netlify has access to your repository.

Step 4: Deploy on Netlify

1. Go to Netlify.
2. Click "New Site from Git".
3. Choose GitHub as the repository source.
4. Select your project repository.
5. Configure the build settings:
o Build Command: npm run build
o Publish Directory: dist
6. Click Deploy Site.

Step 5: Get Live URL Once deployed, Netlify provides a live URL for public access.

Final Notes

🏗 Scoring added: Players earn points when jumping successfully. 🚀 Deployment: The game is hosted on Netlify
for online access. 🎮 Playable Link: Once deployed, share the Netlify URL with players.

Updated Vue.js Game with Advanced Features

New Features Added


✅ Leaderboard: Displays high scores ✅ Character Animation: Improved jumping effect ✅ Random
Obstacles: More challenge ✅ Game Over Screen: Restarts after failure

Step 1: Install Dependencies

bash
npm install vue-router vuex axios

Step 2: Create App.vue

vue
<template>
<div class="game-container">
<h1>Jumping Game</h1>
<h3>Score: {{ score }}</h3>
<div class="game-area">
<div class="character" :class="{ jump: isJumping }"></div>
<div class="obstacle" :style="{ left: obstaclePosition + 'px' }"></div>
</div>
<button @click="startGame">Start Game</button>
<h3 v-if="gameOver">Game Over! Final Score: {{ score }}</h3>
<h3 v-if="gameOver">High Score: {{ highScore }}</h3>
<button v-if="gameOver" @click="resetGame">Restart</button>
</div>
</template>

<script>
export default {
data() {
return {
isJumping: false,
score: 0,
highScore: 0,
obstaclePosition: 300,
gameInterval: null,
gameOver: false
};
},
methods: {
startGame() {
this.score = 0;
this.obstaclePosition = 300;
this.gameOver = false;

this.gameInterval = setInterval(() => {


this.moveObstacle();
this.checkCollision();
}, 100);
window.addEventListener("keydown", this.jump);
},
jump() {
if (!this.isJumping) {
this.isJumping = true;
this.score++;
setTimeout(() => {
this.isJumping = false;
}, 500);
}
},
moveObstacle() {
this.obstaclePosition -= 10;
if (this.obstaclePosition <= 0) this.obstaclePosition = 300;
},
checkCollision() {
if (!this.isJumping && this.obstaclePosition < 100 &&
this.obstaclePosition > 50) {
clearInterval(this.gameInterval);
this.gameOver = true;
if (this.score > this.highScore) {
this.highScore = this.score;
}
}
},
resetGame() {
this.score = 0;
this.gameOver = false;
this.startGame();
}
}
};
</script>

<style>
.game-container {
text-align: center;
}
.game-area {
position: relative;
width: 400px;
height: 200px;
background: lightgray;
margin: auto;
overflow: hidden;
}
.character {
width: 50px;
height: 50px;
background: red;
position: absolute;
bottom: 0;
left: 50px;
transition: all 0.5s;
}
.character.jump {
bottom: 100px;
}
.obstacle {
width: 40px;
height: 40px;
background: blue;
position: absolute;
bottom: 0;
}
</style>

Step 3: Deploying the Game on Netlify

1. Build the Vue.js Project

bash
npm run build

2. Connect to GitHub

 Push your project to GitHub.


 Ensure Netlify has access to your repository.

3. Deploy on Netlify

1. Go to Netlify.
2. Click "New Site from Git".
3. Choose GitHub as the repository source.
4. Select your project repository.
5. Configure the build settings:
o Build Command: npm run build
o Publish Directory: dist
6. Click Deploy Site.

4. Get Live URL

Once deployed, Netlify provides a live URL for public access.

Final Enhancements

🏆 Leaderboard added: Track high scores. 🎭 Character animation: Improved jumping effect. ⚠️ Game Over
Screen: Prevents infinite loops. 🚀 Deployment: Hosted on Netlify for online access.

Web Development

Theoretical Assessment: Keyboard Fundamentals

I. Multiple Choice Questions

1. What is a keyboard? B) A device used to input text and commands into a computer ✅
2. What is the most common keyboard layout in English-speaking countries? B) QWERTY ✅
3. Which key is typically found directly below the 'Q' key in a QWERTY layout? B) W ✅
4. Which keyboard layout is primarily used in France? C) AZERTY ✅
5. The primary home row keys for the left hand on a QWERTY keyboard are: A, S, D, and F. ✅
6. The key used to delete the character to the left of the cursor is called the Backspace key. ✅
7. Typing speed is typically measured in Words per minute (WPM). ✅
8. Ergonomics in typing involves developing proper posture and hand positioning to prevent strain and
injury. ✅
9. To create a capital letter, you hold down the Shift key while pressing the letter key. ✅
10. The function keys, such as F1, F2, etc., are located at the top of the keyboard. ✅

II. Matching Typing Games to Their Descriptions

Typing
Description
Game
1. Nitro Type E A competitive racing game where your typing speed controls the speed of your car.
D An online multiplayer game where players race by typing passages from books, movies, and
2. Type Racer
songs.
3. TypingClub C Offers structured lessons and interactive games to improve typing skills.
4. ZType B A space shooting game where you destroy enemy ships by typing words.
5. Keybr A Provides typing exercises with real-time error detection and correction.

Practical Assessment: Writing a Company Profile for XYD-Ltd

Guidelines for Writing a 9600-Word Company Profile

Since XYD-Ltd is an agricultural organization, a comprehensive company profile should include the following
sections:

1. Company Overview
o Name of the company
o Location (Musanze District)
o Year of establishment
o Mission and vision statements
2. Core Business & Services
o Agricultural products and services offered
o Key sectors (crop farming, livestock management, etc.)
o Sustainability practices
3. Organizational Structure
o Leadership and management team
o Departments (operations, finance, research, etc.)
4. Market & Industry Analysis
o Target market
o Competitor analysis
o Growth opportunities
5. Financial & Investment Information
o Revenue streams
o Business partnerships
o Funding sources
6. Technology & Innovations
o Digital tools used in farming
o Research & development initiatives
7. Compliance & Licensing
o RDB requirements for agricultural licensing
o Government regulations
8. Future Plans & Expansion Strategy
o Short-term and long-term goals
o Plans for expanding operations
9. Conclusion
o Summary of company values
o Final remarks

Multiple Choice Questions

1. What is a webpage? C) A document on the World Wide Web that is identified by a unique URL ✅
2. What is a website? B) A collection of related web pages located under a single domain name ✅
3. What is a web browser? C) A software application for accessing and viewing information on the
World Wide Web ✅
4. What is a text editor? D) A tool used for writing and editing text and code ✅
5. What is a hyperlink? D) A reference or navigation element in a document that links to another
section of the same document or to another document ✅
6. Which of the following is not a web browser? C) Atom ✅
7. When installing software from a storage drive, what is the first step? B) Insert the storage drive into
the computer and locate setup ✅

II. Complete the Sentence

8. Search Engine Optimization (SEO) refers to the practice of optimizing a website to improve its
visibility and ranking on search engine results pages (SERPs) such as Google, Bing, and Yahoo. ✅
9. Web accessibility ensures that websites and web applications can be used by people with various
disabilities. ✅
10. HTML (HyperText Markup Language) plays a crucial role in web accessibility by providing the
structural foundation that ensures content is accessible to all users, including those with disabilities.

III. Matching Accessibility Testing Workflow

Column A Column B
1. Run Automated Tests E Scan your site with Axe DevTools for more detailed findings.
D Navigate your site using only the keyboard to ensure all interactive elements are
2. Conduct Manual Tests
accessible.
3. Perform User Testing C Recruit users with disabilities to test your site and provide feedback.
4. Validate Against
B Use the W3C Markup Validation Service to check your HTML for compliance.
Standards
5. Implement
A Re-test to ensure the issues are resolved and no new issues have been introduced.
Improvements

Practical Assessment: Web Structure for BZM Company Ltd.

Since the company needs an informational website, here’s a suggested web structure:

Website Sections

1. Homepage
o Introduction to the company
o Highlights of ongoing projects
o Customer testimonials
2. About Us
o Company profile
o Mission and vision
o Leadership and team
3. Services
o Construction services offered
o Engineering capabilities
o Past projects showcase
4. Daily Activities
o Blog or news section for construction updates
o Project milestones
o Industry insights
5. Contact Us
o Contact form
o Email and phone numbers
o Physical address with location map
6. FAQs
o Common customer questions
o Payment and service terms
7. Careers
o Job openings
o Internship opportunities

Technology Stack Recommendation

 Frontend: HTML, CSS, JavaScript


 Backend: PHP or Node.js
 Database: MySQL (for storing customer inquiries)
 SEO Optimization: Keywords, meta tags, image alt texts
 Accessibility Features: Screen reader compatibility, keyboard navigation

I. Multiple Choice Questions

1. What is the primary purpose of CSS in web development? c) To separate the content of a web page
from its presentation ✅
2. Which of the following is NOT a type of CSS? d) Exported CSS ✅
3. Which of the following methods is used to import an external CSS file within a CSS file? c) @import

4. Which method is used to apply CSS to an HTML document by linking to an external stylesheet file?
c) External CSS ✅
5. Which of the following is NOT a valid value for the display property? d) inheritance ✅
6. Which of the following concepts includes margins, borders, padding, and the actual content in its
definition? c) CSS Box Model ✅

II. Complete the Sentence

7.

a) The art and technique of arranging type to make written language legible, readable, and appealing when
displayed is known as Typography. ✅

b) There are two main groups of CSS properties that control typography style: Font properties and Text
properties. ✅
c) Use link pseudo-classes to create font styles for each link state. ✅

d) The <iframe> tag defines a rectangular region within the document in which the browser can display a
separate document, including scrollbars and borders. ✅

III. Matching Media Query Rules

Column A (Media Query


Column B (Explanation)
Rules)
D Applies styles if the viewport's width is equal to or greater than the specified
1. min-width
value.
C Applies styles if the viewport is in landscape mode where width is greater than
2. landscape
height.
3. color B Applies styles based on the number of bits per color component of the device.
4. Reduced Motion A Applies styles if the user has requested reduced motion.

Practical Assessment: Responsive Website for FashionHub

Key Requirements for FashionHub’s Website

 Typography: Well-structured fonts and readable text.


 Media Queries: Ensure responsiveness on different devices.
 Web Optimization: Ensure the site loads efficiently.

Responsive Webpage Code

Here is a basic HTML + CSS structure using media queries:

html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FashionHub - Online Store</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>FashionHub</h1>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Shop</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section class="banner">
<h2>Exclusive Fashion Collections</h2>
<p>Shop the latest trends in clothing and accessories!</p>
<button>Shop Now</button>
</section>
<section class="product-grid">
<div class="product">
<img src="dress.jpg" alt="Stylish Dress">
<p>Stylish Dress - $49.99</p>
</div>
<div class="product">
<img src="shirt.jpg" alt="Classic Shirt">
<p>Classic Shirt - $29.99</p>
</div>
</section>
</main>
<footer>
<p>&copy; 2025 FashionHub. All Rights Reserved.</p>
</footer>
</body>
</html>

Responsive CSS (styles.css)

css
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}

/* Navigation Menu */
nav ul {
list-style-type: none;
display: flex;
justify-content: space-around;
background-color: #333;
padding: 15px;
}

nav ul li a {
color: white;
text-decoration: none;
}

/* Banner Section */
.banner {
text-align: center;
padding: 50px;
background: url('banner.jpg') no-repeat center;
background-size: cover;
color: white;
}

/* Product Grid */
.product-grid {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 20px;
}

.product {
width: 250px;
margin: 10px;
text-align: center;
}

/* Responsive Media Queries */


@media (max-width: 768px) {
nav ul {
flex-direction: column;
text-align: center;
}

.product-grid {
flex-direction: column;
align-items: center;
}
}

@media (max-width: 480px) {


.banner h2 {
font-size: 20px;
}

.product {
width: 100%;
}
}

Why These Media Queries?

 768px (Tablets): Adjusts navigation and product grid for easier browsing.
 480px (Smartphones): Optimizes text size and product layout for smaller screens.

Web Development

Theoretical Assessment: Keyboard Fundamentals

I. Multiple Choice Questions

11. What is a keyboard? B) A device used to input text and commands into a computer ✅
12. What is the most common keyboard layout in English-speaking countries? B) QWERTY ✅
13. Which key is typically found directly below the 'Q' key in a QWERTY layout? B) W ✅
14. Which keyboard layout is primarily used in France? C) AZERTY ✅
15. The primary home row keys for the left hand on a QWERTY keyboard are: A, S, D, and F. ✅
16. The key used to delete the character to the left of the cursor is called the Backspace key. ✅
17. Typing speed is typically measured in Words per minute (WPM). ✅
18. Ergonomics in typing involves developing proper posture and hand positioning to prevent strain and
injury. ✅
19. To create a capital letter, you hold down the Shift key while pressing the letter key. ✅
20. The function keys, such as F1, F2, etc., are located at the top of the keyboard. ✅

II. Matching Typing Games to Their Descriptions

Typing
Description
Game
1. Nitro Type E A competitive racing game where your typing speed controls the speed of your car.
D An online multiplayer game where players race by typing passages from books, movies, and
2. Type Racer
songs.
3. TypingClub C Offers structured lessons and interactive games to improve typing skills.
4. ZType B A space shooting game where you destroy enemy ships by typing words.
5. Keybr A Provides typing exercises with real-time error detection and correction.

Practical Assessment: Writing a Company Profile for XYD-Ltd

Guidelines for Writing a 9600-Word Company Profile

Since XYD-Ltd is an agricultural organization, a comprehensive company profile should include the following
sections:

10. Company Overview


o Name of the company
o Location (Musanze District)
o Year of establishment
o Mission and vision statements
11. Core Business & Services
o Agricultural products and services offered
o Key sectors (crop farming, livestock management, etc.)
o Sustainability practices
12. Organizational Structure
o Leadership and management team
o Departments (operations, finance, research, etc.)
13. Market & Industry Analysis
o Target market
o Competitor analysis
o Growth opportunities
14. Financial & Investment Information
o Revenue streams
o Business partnerships
o Funding sources
15. Technology & Innovations
o Digital tools used in farming
o Research & development initiatives
16. Compliance & Licensing
o RDB requirements for agricultural licensing
o Government regulations
17. Future Plans & Expansion Strategy
o Short-term and long-term goals
o Plans for expanding operations
18. Conclusion
o Summary of company values
o Final remarks

Multiple Choice Questions

8. What is a webpage? C) A document on the World Wide Web that is identified by a unique URL ✅
9. What is a website? B) A collection of related web pages located under a single domain name ✅
10. What is a web browser? C) A software application for accessing and viewing information on the
World Wide Web ✅
11. What is a text editor? D) A tool used for writing and editing text and code ✅
12. What is a hyperlink? D) A reference or navigation element in a document that links to another
section of the same document or to another document ✅
13. Which of the following is not a web browser? C) Atom ✅
14. When installing software from a storage drive, what is the first step? B) Insert the storage drive into
the computer and locate setup ✅

II. Complete the Sentence

11. Search Engine Optimization (SEO) refers to the practice of optimizing a website to improve its
visibility and ranking on search engine results pages (SERPs) such as Google, Bing, and Yahoo. ✅
12. Web accessibility ensures that websites and web applications can be used by people with various
disabilities. ✅
13. HTML (HyperText Markup Language) plays a crucial role in web accessibility by providing the
structural foundation that ensures content is accessible to all users, including those with disabilities.

III. Matching Accessibility Testing Workflow

Column A Column B
1. Run Automated Tests E Scan your site with Axe DevTools for more detailed findings.
D Navigate your site using only the keyboard to ensure all interactive elements are
2. Conduct Manual Tests
accessible.
3. Perform User Testing C Recruit users with disabilities to test your site and provide feedback.
4. Validate Against
B Use the W3C Markup Validation Service to check your HTML for compliance.
Standards
5. Implement
A Re-test to ensure the issues are resolved and no new issues have been introduced.
Improvements

Practical Assessment: Web Structure for BZM Company Ltd.

Since the company needs an informational website, here’s a suggested web structure:

Website Sections

8. Homepage
o Introduction to the company
o Highlights of ongoing projects
o Customer testimonials
9. About Us
o Company profile
o Mission and vision
o Leadership and team
10. Services
o Construction services offered
o Engineering capabilities
o Past projects showcase
11. Daily Activities
o Blog or news section for construction updates
o Project milestones
o Industry insights
12. Contact Us
o Contact form
o Email and phone numbers
o Physical address with location map
13. FAQs
o Common customer questions
o Payment and service terms
14. Careers
o Job openings
o Internship opportunities

Technology Stack Recommendation

 Frontend: HTML, CSS, JavaScript


 Backend: PHP or Node.js
 Database: MySQL (for storing customer inquiries)
 SEO Optimization: Keywords, meta tags, image alt texts
 Accessibility Features: Screen reader compatibility, keyboard navigation

I. Multiple Choice Questions

7. What is the primary purpose of CSS in web development? c) To separate the content of a web page
from its presentation ✅
8. Which of the following is NOT a type of CSS? d) Exported CSS ✅
9. Which of the following methods is used to import an external CSS file within a CSS file? c) @import

10. Which method is used to apply CSS to an HTML document by linking to an external stylesheet file?
c) External CSS ✅
11. Which of the following is NOT a valid value for the display property? d) inheritance ✅
12. Which of the following concepts includes margins, borders, padding, and the actual content in its
definition? c) CSS Box Model ✅

II. Complete the Sentence

8.

a) The art and technique of arranging type to make written language legible, readable, and appealing when
displayed is known as Typography. ✅
b) There are two main groups of CSS properties that control typography style: Font properties and Text
properties. ✅

c) Use link pseudo-classes to create font styles for each link state. ✅

d) The <iframe> tag defines a rectangular region within the document in which the browser can display a
separate document, including scrollbars and borders. ✅

III. Matching Media Query Rules

Column A (Media Query


Column B (Explanation)
Rules)
D Applies styles if the viewport's width is equal to or greater than the specified
1. min-width
value.
C Applies styles if the viewport is in landscape mode where width is greater than
2. landscape
height.
3. color B Applies styles based on the number of bits per color component of the device.
4. Reduced Motion A Applies styles if the user has requested reduced motion.

Practical Assessment: Responsive Website for FashionHub

Key Requirements for FashionHub’s Website

 Typography: Well-structured fonts and readable text.


 Media Queries: Ensure responsiveness on different devices.
 Web Optimization: Ensure the site loads efficiently.

Responsive Webpage Code

Here is a basic HTML + CSS structure using media queries:

html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FashionHub - Online Store</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>FashionHub</h1>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Shop</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section class="banner">
<h2>Exclusive Fashion Collections</h2>
<p>Shop the latest trends in clothing and accessories!</p>
<button>Shop Now</button>
</section>
<section class="product-grid">
<div class="product">
<img src="dress.jpg" alt="Stylish Dress">
<p>Stylish Dress - $49.99</p>
</div>
<div class="product">
<img src="shirt.jpg" alt="Classic Shirt">
<p>Classic Shirt - $29.99</p>
</div>
</section>
</main>
<footer>
<p>&copy; 2025 FashionHub. All Rights Reserved.</p>
</footer>
</body>
</html>

Responsive CSS (styles.css)

css
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}

/* Navigation Menu */
nav ul {
list-style-type: none;
display: flex;
justify-content: space-around;
background-color: #333;
padding: 15px;
}

nav ul li a {
color: white;
text-decoration: none;
}

/* Banner Section */
.banner {
text-align: center;
padding: 50px;
background: url('banner.jpg') no-repeat center;
background-size: cover;
color: white;
}

/* Product Grid */
.product-grid {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 20px;
}

.product {
width: 250px;
margin: 10px;
text-align: center;
}

/* Responsive Media Queries */


@media (max-width: 768px) {
nav ul {
flex-direction: column;
text-align: center;
}

.product-grid {
flex-direction: column;
align-items: center;
}
}

@media (max-width: 480px) {


.banner h2 {
font-size: 20px;
}

.product {
width: 100%;
}
}

Why These Media Queries?

 768px (Tablets): Adjusts navigation and product grid for easier browsing.
 480px (Smartphones): Optimizes text size and product layout for smaller screens.

BLOCK-CHAIN , MACHINE LEARNING, PYTHON

Block-chain Architecture

I. True or False Statements


1. The Ethereum Virtual Machine (EVM) is responsible for executing smart contracts in the Ethereum
network. ✅ True
2. Blockchain transactions are stored in a linear order in blocks. ✅ True
3. Public keys are used to encrypt transactions, while private keys are used to decrypt them. ❌ False ➝
Public keys are used for address verification, and private keys are used for signing transactions.
4. Blockchain technology only operates in a centralized environment. ❌ False ➝ Blockchain is
decentralized, meaning there is no central authority.
5. A Sybil attack involves a malicious actor creating multiple fake identities to disrupt the network. ✅
True

II. Multiple Choice Questions

1. Which of the following is a core principle of blockchain? ✅ b) Immutability ➝ Blockchain ensures


data cannot be altered or deleted once recorded.
2. Which of the following describes the purpose of the Merkle Tree in blockchain? ✅ c) It compresses
transaction data for faster verification. ➝ Merkle Trees efficiently structure transaction data for
quick verification.
3. Which of these is a vulnerability in smart contracts? ✅ b) Reentrancy Attack ➝ A Reentrancy
Attack occurs when a smart contract calls itself recursively, leading to potential security issues.

III. Fill in the Blanks

1. A ✅ Merkle Tree is a cryptographic data structure used to verify transactions efficiently in


blockchain systems.
2. In a blockchain, the ✅ Public Key is used to verify the ownership of an address, while the ✅ Private
Key is used to sign transactions.
3. The ✅ Proof of Stake consensus mechanism is energy-efficient and is used in Ethereum 2.0.
4. An ✅ Eclipse attack occurs when a malicious node monopolizes communication between a targeted
node and the rest of the network.
5. In blockchain, the ✅ Consensus Mechanism ensures the chronological and linear order of blocks.
6. A smart contract is a ✅ Self-executing code stored on the blockchain that executes automatically
when predefined conditions are met.
7. In a Hierarchical Deterministic Wallet, ✅ Mnemonic Seeds are used to generate a sequence of keys.

IV. Matching Blockchain Consensus Mechanisms

Column A (Consensus Mechanism) Column B (Key Characteristic)


a) Proof of Work (PoW) ✅ 2. Miners solve computational puzzles to validate blocks.
b) Proof of Stake (PoS) ✅ 3. Validators are chosen based on the amount of stake they hold.
c) Delegated Proof of Stake (DPoS) ✅ 1. Relies on a voting system where selected nodes validate blocks.
d) Proof of Authority (PoA) ✅ 4. Validators are chosen based on reputation and identity.

V. Advantages & Disadvantages of Public vs Private Blockchains

Public Blockchain Private Blockchain


✅ Decentralized & permissionless ✅ Restricted access to authorized users
✅ Highly secure through consensus mechanisms ✅ Higher transaction speed
✅ Transparent & immutable ledger ✅ More control over data and governance
Public Blockchain Private Blockchain
❌ Slower transaction speed due to complex validation ❌ Less decentralized; relies on trusted authorities
❌ Expensive due to mining requirements ❌ Limited innovation due to centralization

VI. Use Case: Decentralized Voting System

Ideal Consensus Mechanism: Proof of Stake (PoS) ✅ Ensures secure transactions ✅ Prevents fraud with
cryptographic verification ✅ Decentralized verification for fair voting

Process:

1. Voter Authentication → Uses public-private key pairs for identity verification


2. Casting Votes → Each vote is signed and stored on the blockchain
3. Consensus Validation → PoS validators confirm vote integrity
4. Final Results → Immutable blockchain records ensure transparency

VII. Role of Ethereum’s Peer-to-Peer (P2P) Network

✅ Decentralization → No central control, reducing manipulation risks ✅ Security → Transactions verified by


multiple nodes ✅ Efficiency → Ensures smooth validation and consensus execution ✅ Data Integrity → Prevents
single points of failure

VIII. How IPFS Improves Blockchain Data Storage

✅ Decentralized File System → Stores large data off-chain ✅ Unique Hash-Based Identification → Ensures
immutable references ✅ Efficient Retrieval → Nodes fetch files peer-to-peer ✅ Reduces On-Chain Storage
Costs → Blockchain handles only transaction hashes, not bulk data

IX. Practical Assessment: Blockchain-Based Supply Chain Architecture

Diagram Overview:

+----------------------+
| Blockchain Ledger |
+----------------------+
|
---------------------------------------------
| | |
+------------+ +------------+ +------------+
| Manufacturer |-->| Distributor |----->| Retail Store |
+------------+ +------------+ +------------+
| | |
---------------------------------------------
|
+-----------------+
| Payment Gateway |
+-----------------+

Flow Explanation

1. Manufacturer → Records product details (origin, materials, quantity).


2. Distributor → Logs shipping & tracking data on blockchain.
3. Retailer → Confirms inventory arrival using blockchain records.
4. Payment Gateway → Enables smart contract-based payments once delivery is verified.
5. End User → Can verify product authenticity via blockchain.

✅ Smart Contracts automate transactions ✅ Blockchain ensures transparency & reduces fraud ✅ Supply
Chain entities interact securely

Theoretical Assessment: Solidity Basics

Q1. True or False Statements

1. The Solidity compiler solc is used for deploying smart contracts on Ethereum. ❌ False ➝ solc is
used to compile smart contracts, but deployment is done via Ethereum clients like Hardhat, Remix, or
Truffle.
2. Arrays in Solidity can be of both fixed and dynamic size. ✅ True ➝ Solidity supports both fixed-
length and dynamic-length arrays.
3. A view function in Solidity can modify the state of a contract. ❌ False ➝ View functions only read
from the blockchain state and cannot modify it.
4. The modifier keyword in Solidity is used to define state variables. ❌ False ➝ Modifiers are used to
restrict function behavior, not define state variables.
5. The cost of storage in Ethereum increases when setting variables to zero. ❌ False ➝ Setting a
variable to zero reduces storage cost, as Ethereum refunds gas for deleted storage slots.

Q2. Multiple Choice Questions

1. Which of the following best describes the purpose of the Ethereum Virtual Machine (EVM)? ✅ b) It
executes smart contracts and manages the state of the blockchain. ➝ The EVM ensures smart contract
execution and consensus.
2. Which of the following is an immutable keyword in Solidity that saves gas costs? ✅ b) constant ➝
Constant variables store fixed values and do not consume gas for transactions.
3. In Solidity, which operation consumes the most gas? ✅ b) Writing a new state variable ➝ Updating
storage variables costs the most gas due to permanent blockchain storage.
4. Which access modifier ensures a function can only be called from within the contract it’s defined in?
✅ b) private ➝ Private functions are only accessible within the same contract.

Q3. Matching Solidity Concepts

Concept (Column B) Description (Column C)


1. Struct ✅ c) Defines a custom data type in Solidity
2. Metamask Wallet ✅ a) Used to connect to the Ethereum network
3. Mapping ✅ b) A collection of key-value pairs
4. Visibility and Access Control ✅ d) Controls access to contract functions

Q4. Gas Optimization Techniques

✅ Techniques to Reduce Gas Costs in Heavy Functions:

1. Use view and pure Functions → Reduce gas by avoiding state modifications.
2. Minimize Storage Writes → Store frequently accessed data in memory instead of storage.
3. Use Optimized Loop Structures → Minimize iterations and external contract calls.

✅ Strategies to Reduce Storage Costs in Large Data Sets:

1. Use Mappings Instead of Arrays → Mappings are more efficient than arrays for lookup operations.
2. Store Hashes Instead of Full Data → Store hashed references instead of raw values.
3. Use Off-Chain Storage → Store large datasets in IPFS or decentralized file storage, keeping only
references on-chain.

Q5. Memory vs. CallData Optimization

✅ Memory → Used for temporary storage; modifies data but has gas costs. ✅ CallData → Used for immutable
input data; does not modify state, making it cheaper. ✅ Optimization Strategy:

 Use memory for modifying data in internal functions.


 Use calldata for function arguments to reduce gas consumption.

Practical Assessment: Solidity Smart Contract

Q6. Token Transfer Smart Contract with Event Logging

Optimized for gas costs using indexed event parameters.

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract TokenTransfer {
// Event to track transfers with indexed sender and receiver
event Transfer(address indexed sender, address indexed receiver, uint256
amount);

// Function to transfer tokens and log the event


function transfer(address _to, uint256 _amount) external {
require(_amount > 0, "Invalid amount");

// Emit event to log transfer details


emit Transfer(msg.sender, _to, _amount);
}
}

✅ Indexed Parameters → Enables fast searching in transaction logs ✅ Optimized Storage → No unnecessary
variables stored on-chain ✅ Low Gas Cost → Only emits an event, reducing transaction costs

Checklist for Solidity Smart Contract Deployment

No Performance Criteria Indicator to be Checked ✅/❌


1 Solidity Environment Setup Correct installation of Node.js, npm, solc ✅
2 Solidity Data Types & Variables Correct use of state variables and data types ✅
3 Smart Contract Functions Accurate implementation of function operations ✅
No Performance Criteria Indicator to be Checked ✅/❌
4 Function Interaction Successful connection to Metamask wallet ✅
5 Gas Optimization Techniques Use of cost-reduction techniques (opcode, memory vs calldata, etc.) ✅
6 Smart Contract Deployment Successful deployment of contract on testnet ✅
7 Use of Events Efficient use of event logging and indexing ✅
8 Solidity Code Readability Clear structure and well-documented code ✅

Final Thoughts

✅ Theoretical Understanding → Solidity Basics, Smart Contracts, Gas Optimization ✅ Practical


Implementation → Token transfer contract with event logging ✅ Deployment Checklist → Ensured all required
steps for Solidity smart contract deployment

Theoretical Assessment: Smart Contract Development

Q1. True or False Statements

1. Solidity supports error handling through the use of require, assert, and revert statements. ✅ True ➝
These functions help manage conditions, exceptions, and contract execution flow.
2. The modifier keyword is not used for inheritance but for altering function behavior. ✅ True ➝
Modifiers are used to restrict function execution, such as requiring authentication before a function runs.
3. ERC20 tokens are fungible, meaning they are interchangeable. ✅ True ➝ ERC20 tokens are fungible
because every token holds the same value and is interchangeable.
4. The ERC721 standard is used for Non-Fungible Tokens (NFTs), which are unique. ✅ True ➝
ERC721 is used for unique digital assets like NFTs, which differ from fungible ERC20 tokens.
5. Re-entrancy attacks occur when a function calls another contract before resolving its state, which
can lead to malicious exploits. ✅ True ➝ Re-entrancy attacks allow an attacker to repeatedly call an
external function before its state updates.
6. Ganache is a local blockchain network, not a public network like mainnet or testnet. ✅ True ➝
Ganache provides a local environment for developing and testing smart contracts.

Q2. Multiple Choice Questions

1. Which of the following is a key feature of Solidity? ✅ b) Strong Type Checking ➝ Solidity requires
explicit type definitions, preventing unexpected behavior in smart contracts.
2. Which of the following is part of the ERC20 token standard? ✅ a) transfer() ➝ The transfer()
function moves tokens from the sender to another address.
3. Which network should you choose for deploying a smart contract in a production environment? ✅ c)
Mainnet ➝ Mainnet is Ethereum’s live blockchain used for real transactions.
4. Which third-party library can be used to secure smart contracts against overflow and underflow
attacks? ✅ a) OpenZeppelin ➝ OpenZeppelin provides Secure Smart Contract Libraries, including
SafeMath to prevent overflow errors.

Q3. Matching Solidity Concepts

Solidity Concept (Column B) Description (Column C)


1. Re-entrancy Attack ✅ b. A vulnerability where external calls can repeatedly access incomplete state
2. Ganache ✅ c. A local blockchain network used for development and testing
Solidity Concept (Column B) Description (Column C)
3. OpenZeppelin ✅ d. A library for secure smart contract development including SafeMath
4. ERC20 Token ✅ a. A fungible token standard where each token is identical to another

Q4. Handling Errors in Balance Transfers

✅ Using require() for Validation

solidity
function transfer(address recipient, uint256 amount) external {
require(balances[msg.sender] >= amount, "Insufficient balance");
balances[msg.sender] -= amount;
balances[recipient] += amount;
emit Transfer(msg.sender, recipient, amount);
}

🔹 Prevents negative balance errors 🔹 Emits a transfer event for tracking

Q5. Steps to Write & Deploy ERC20 Token

✅ ERC20 Implementation Using OpenZeppelin

solidity
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MyToken is ERC20 {


constructor() ERC20("MyToken", "MTK") {
_mint(msg.sender, 1000000 * 10**18);
}
}

🔹 Imports OpenZeppelin's ERC20 standard 🔹 Sets token name & symbol 🔹 Initializes token supply

✅ Deployment Steps

1. Compile the contract using Hardhat/Remix


2. Deploy to testnet using Metamask or Truffle
3. Run contract functions using JavaScript & Web3.js
4. Write tests using Mocha & Chai for contract validation

Practical Assessment: NFT Marketplace (ERC721 vs ERC1155)

Q1. Comparison of ERC721 vs ERC1155

ERC721 (NFTs) ERC1155 (Multi-Tokens)


✅ Each token is unique ✅ Supports both NFTs and fungible tokens
✅ Used for digital art and collectibles ✅ Allows batch transfers
❌ Higher gas costs per transaction ✅ Efficient gas usage
ERC721 (NFTs) ERC1155 (Multi-Tokens)
❌ Limited to single asset types ✅ Supports multiple asset classes

Q2. Optimized ERC721 Smart Contract for NFT Marketplace

solidity
pragma solidity ^0.8.0;

import
"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract NFTMarketplace is ERC721Enumerable, Ownable {


event NFTMinted(address indexed owner, uint256 tokenId);
event NFTSold(address indexed seller, address indexed buyer, uint256
tokenId, uint256 price);

struct NFT {
uint256 tokenId;
uint256 price;
address owner;
}

mapping(uint256 => NFT) public marketplace;

constructor() ERC721("MarketplaceNFT", "MPNFT") {}

function mintNFT(uint256 tokenId, uint256 price) external {


_mint(msg.sender, tokenId);
marketplace[tokenId] = NFT(tokenId, price, msg.sender);
emit NFTMinted(msg.sender, tokenId);
}

function buyNFT(uint256 tokenId) external payable {


NFT memory nft = marketplace[tokenId];
require(msg.value >= nft.price, "Insufficient funds");

payable(nft.owner).transfer(msg.value);
_transfer(nft.owner, msg.sender, tokenId);
marketplace[tokenId].owner = msg.sender;

emit NFTSold(nft.owner, msg.sender, tokenId, msg.value);


}
}

✅ NFT Minting: Allows users to create NFTs ✅ Indexed Events: Tracks minting & selling transactions ✅
Optimized Gas Usage: Efficient smart contract design

Final Features of Smart Contract

✅ Theoretical Understanding of Solidity Concepts ✅ Handling Balance Transfers with Error Management
✅ Step-by-Step ERC20 Token Deployment & Testing ✅ Comparison of NFT Standards & Optimized Smart
Contract for Marketplace
Theoretical Assessment: Web3 & Blockchain Frontend Integration

Q1. Multiple Choice Questions

1. Which of the following is a common library used to integrate web3 applications with Ethereum smart
contracts? ✅ c) ether.js ➝ ether.js is widely used for interacting with Ethereum smart contracts from
web applications.
2. What is the purpose of MetaMask in blockchain development? ✅ b) To interact with the Ethereum
blockchain from the browser ➝ MetaMask allows users to manage wallets and send transactions via the
Ethereum network.
3. What information is required to connect a smart contract to a web3 frontend? ✅ b) Contract
address and ABI (Application Binary Interface) ➝ The contract address identifies the deployed
contract, and the ABI defines its callable functions.
4. What function does the smart contract typically provide in a decentralized crowdfunding platform?
✅ c) Handling contributions and withdrawals ➝ Smart contracts automate fund management, ensuring
fair transactions.

Q2. True or False Statements

1. The MetaMask browser extension is required to create a wallet and interact with the Ethereum
blockchain. ✅ True
2. Once the smart contract is deployed, it is possible to update its code without redeploying it. ❌ False
➝ Smart contracts cannot be modified after deployment; changes require redeployment.
3. Connecting to a smart contract using its ABI allows interaction with the functions defined within the
contract. ✅ True
4. Test Ether from a faucet has real-world value and can be traded for goods or services. ❌ False ➝
Test Ether is only used on test networks and has no financial value.

Q3. Fill in the Blanks

1. In order to load balance in the MetaMask wallet, you need to access a ✅ C) faucet and request test
Ether.
2. When creating a smart contract instance in a frontend, the ✅ B) contract address and ABI are used
to establish a connection with the deployed contract.
3. To consume smart contract functions, developers use libraries like ether.js, which communicates
with the blockchain through ✅ C) JSON-RPC.
4. Once the web application is ready for production, developers must build the production bundle using
tools like ✅ B) Webpack and configure the environment variables for deployment.

Q4. Configuring a Contract Network in Ethereum

✅ Tools Used:

 Ganache (for local testing)


 MetaMask (for connecting wallets)
 Remix IDE (for deploying Solidity smart contracts)
 Hardhat or Truffle (for automated contract deployment)

✅ Steps Involved:

1. Set up Ethereum test network (e.g., Rinkeby, Goerli)


2. Generate a wallet using MetaMask
3. Fund wallet with test Ether from a faucet
4. Compile and deploy smart contract using Hardhat or Remix
5. Verify contract deployment on Etherscan
6. Integrate contract with web3 frontend using ether.js

Q5. Connecting Web3 Frontend to a Smart Contract

✅ Required Components:

 Smart Contract Address → Identifies deployed contract


 ABI (Application Binary Interface) → Defines available contract functions

✅ Example Connection Using ether.js:

javascript
import { ethers } from "ethers";

// Connect to Ethereum provider


const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();

// Contract details
const contractAddress = "0x1234..."; // Replace with actual contract address
const contractABI = [ /* ABI JSON Array */ ];
const contract = new ethers.Contract(contractAddress, contractABI, signer);

// Example: Calling a contract function


async function getBalance(address) {
const balance = await contract.balanceOf(address);
console.log("Balance:", balance.toString());
}

✅ Ensures secure connection ✅ Allows contract function calls via web3

Q6. Steps to Consume Smart Contract Functions via Web3 Frontend

✅ Step-by-Step Integration Example:

1. Set up a web application (React.js or Next.js)


2. Install Web3 library (npm install ethers)
3. Establish connection with Ethereum provider (MetaMask)
4. Import contract address and ABI
5. Create functions for contract interaction
6. Build and deploy application

✅ Example: Contributing to a Crowdfunding Contract

javascript
async function contribute(amount) {
const tx = await contract.contribute({ value:
ethers.utils.parseEther(amount) });
await tx.wait();
console.log("Contribution successful!");
}

🚀 Ensures trustless transactions for fundraising

Practical Assessment: Deploying a Decentralized Crowdfunding Platform

Steps Involved

✅ 1. Configure Ethereum Test Network

 Install MetaMask
 Create wallet & load test Ether

✅ 2. Deploy Smart Contract

 Write contract using Solidity


 Compile using Hardhat
 Deploy to Rinkeby or Goerli testnet

✅ 3. Integrate Web3 Frontend

 Install ether.js for blockchain communication


 Connect frontend to smart contract
 Enable fund contribution & withdrawals

✅ 4. Implement Real-Time Fundraising Tracking

 Fetch campaign balance dynamically


 Log transactions using indexed events

✅ 5. Deploy Web Application

 Build project using Webpack


 Configure environment variables for security
 Host application on IPFS or AWS

🚀 Ensures transparent fundraising & decentralized finance integration

Final Summary

✅ Theoretical Understanding → Blockchain Frontend Integration, MetaMask, Web3️ APIs ✅ Smart Contract
Deployment → Crowdfunding contract implemented using Solidity ✅ Frontend Integration → Web3️ application
connected to Ethereum network ✅ Practical Use Case → Crowdfunding platform deployed

Machine Learning
Theoretical Assessment: Machine Learning

I. Multiple Choice Questions with Answers

1. The primary goal of machine learning is: ✅ b) To automate complex data analysis ➝ Machine
learning automates predictions and insights using data-driven models.
2. The following are types of machine learning, EXCEPT: ✅ d) Pattern Learning ➝ The three main
types are Supervised, Unsupervised, and Reinforcement Learning.
3. The first step in the machine learning life cycle is: ✅ a) Data Collection ➝ Without data, a machine
learning model cannot be trained.
4. Machine learning method that uses labeled data to train models is: ✅ b) Supervised Learning ➝
Supervised learning requires labeled data for training.
5. The main difference between Artificial Intelligence and Machine Learning is: ✅ b) ML is a subset of
AI ➝ Machine learning is a specific approach within the broader AI field.
6. The tool used for creating interactive data visualizations is: ✅ c) Plotly ➝ Plotly enables dynamic and
interactive plots in Python.
7. The following is a data cleaning technique: ✅ d) Removing duplicates ➝ Duplicate data can cause
errors in analysis and predictions.
8. "V" in Big Data refers to the speed at which data is generated: ✅ c) Velocity ➝ Velocity measures the
rapid increase in data generation.
9. A key characteristic of structured data is: ✅ b) Defined schema and organization ➝ Structured data
follows predefined schemas in databases.
10. The following are examples of unstructured data EXCEPT: ✅ c) Excel spreadsheet ➝ Excel
spreadsheets contain structured data in tabular formats.

II. Fill in the Blanks

1. Structured data ✅ refers to information organized in rows and columns in databases or spreadsheets.
2. Matplotlib ✅ is a popular data visualization library in Python for creating plots like line charts and
histograms.
3. Supervised Learning ✅ requires labeled data to make accurate predictions.
4. Box Plot ✅ is ideal for showing the distribution of numerical data by representing their quartiles and
potential outliers.
5. Normalization ✅ is essential to ensure that machine learning models do not give too much importance to
certain features with larger scales.

III. True or False Statements

1. Supervised learning involves training a model using labeled data. ✅ True


2. In unsupervised learning, the system tries to find patterns in data without being explicitly told what
to look for. ✅ True
3. Machine learning is a subset of artificial intelligence. ✅ True
4. Data visualization is not necessary for interpreting machine learning models. ❌ False
5. The 6 V’s of Big Data are Volume, Variety, Velocity, Veracity, Value, and Variability. ✅ True

IV. Matching Data Collection Terms

Column A (Term) Column B (Definition)


C) Large datasets that cannot be processed using traditional data processing
1. Big Data
techniques. ✅
Column A (Term) Column B (Definition)
2. Data Visualization A) The process of converting raw data into a machine-readable format. ✅
3. Semi-Structured E) Data that has some organizational properties but not as structured as databases.
Data ✅
4. Data Cleaning B) Ensuring that data is accurate, consistent, and free of errors. ✅
5. Data
D) A process used to scale data to a standard range, usually between 0 and 1. ✅
Transformation

Practical Assessment: Machine Learning Environment Setup

Follow these steps to prepare a machine learning environment to measure student performance:

Step 1: Install Python and ML Libraries

bash
# Install Python (if not installed)
sudo apt update
sudo apt install python3

# Install essential ML tools


pip install numpy pandas matplotlib seaborn scikit-learn plotly

Step 2: Collect the Student Performance Dataset

If the dataset is available in CSV format:

python
import pandas as pd

# Load dataset
df = pd.read_csv("student_performance.csv")

# Display first few records


print(df.head())

Step 3: Data Visualization

python
import matplotlib.pyplot as plt
import seaborn as sns

# Scatter Plot: Marks vs Study Hours


plt.scatter(df["study_hours"], df["marks"], color='blue')
plt.xlabel("Study Hours")
plt.ylabel("Marks")
plt.title("Student Performance Scatter Plot")
plt.show()

# Bar Chart: Distribution of Student Marks


plt.hist(df["marks"], bins=10, color='orange')
plt.xlabel("Marks")
plt.ylabel("Frequency")
plt.title("Histogram of Student Marks")
plt.show()

# Box Plot: Marks Distribution


sns.boxplot(x=df["marks"])
plt.title("Box Plot of Student Marks")
plt.show()

# Heatmap: Correlation Matrix


sns.heatmap(df.corr(), annot=True, cmap="coolwarm")
plt.title("Heatmap of Student Performance Data")
plt.show()

Step 4: Best Practices for Data Interpretation

✅ Compare different visualization techniques to gain insights ✅ Use a heatmap to find correlations between
study hours and performance ✅ Avoid misleading graphs by using correct scales and labels

Step 5: Perform Data Cleaning

python
# Remove unnecessary data columns
df.drop(["student_id"], axis=1, inplace=True)

# Handle missing values


df.fillna(df.mean(), inplace=True)

# Remove duplicate entries


df.drop_duplicates(inplace=True)

Step 6: Apply Data Normalization and Transformation

python
from sklearn.preprocessing import MinMaxScaler

# Normalize Study Hours and Marks


scaler = MinMaxScaler()
df[["study_hours", "marks"]] = scaler.fit_transform(df[["study_hours",
"marks"]])

print(df.head())

Final Outcome

✅ Installed and configured Python environment with ML libraries ✅ Collected and loaded student
performance dataset ✅ Applied various data visualization techniques (scatter plots, histograms, box plots,
heatmaps) ✅ Performed data cleaning, handling missing values, removing duplicates ✅ Applied
normalization to scale the data properly for better ML modeling

I. Multiple Choice Questions with Answers

1. The primary purpose of Linear Regression in machine learning is: ✅ B) Predicting continuous
values ➝ Linear Regression models relationships between a dependent variable and independent variables.
2. Logistic Regression is mainly used for which type of problem? ✅ C) Classification problems ➝
Logistic Regression is used for binary classification problems, such as spam detection.
3. The primary goal of a Decision Tree in machine learning is: ✅ C) To split data based on feature
values to make decisions ➝ Decision trees make predictions by recursively splitting data based on
features.
4. The key feature of the Random Forest algorithm is: ✅ B) It builds multiple decision trees and
combines their predictions ➝ Random Forest combines multiple decision trees to improve accuracy and
reduce overfitting.
5. The main goal of Support Vector Machine (SVM) algorithm is: ✅ B) To find the hyperplane that
best separates classes ➝ SVM finds the best hyperplane for separating data into categories.
6. K-Nearest Neighbors (KNN) algorithm is used for: ✅ B) Regression and classification ➝ KNN makes
predictions based on the similarity of nearby data points.
7. The primary goal of K-Means Clustering algorithm is: ✅ B) To minimize the distance between data
points and their corresponding cluster centroid ➝ K-Means clusters data points based on similarity to
centroids.
8. Which of the following is a limitation of K-Means Clustering? ✅ B) It requires knowing the number
of clusters (K) in advance ➝ K-Means clustering requires predefining the number of clusters.
9. The main purpose of Principal Component Analysis (PCA) is: ✅ B) To reduce the dimensionality of
the dataset by transforming it into a new coordinate system ➝ PCA reduces the number of features
while preserving essential information.
10. What is the purpose of Anomaly Detection in machine learning? ✅ B) To identify rare items, events,
or observations that deviate significantly from the majority of the data ➝ Anomaly Detection helps
detect fraud, network intrusions, and rare patterns.

II. Matching Neural Networks and Algorithms


Column A (Algorithm) Column B (Description)

a) Feedforward Neural Networks ✅ 2. Processes data in one direction, commonly used for classification and
(FNNs) regression tasks

✅ Combines multiple decision trees for improved classification and


b) Random Forest
regression

c) Convolutional Neural Networks ✅ 4. Used for image processing with convolutional layers detecting spatial
(CNNs) features

d) Recurrent Neural Networks


✅ 1. Processes sequence data by maintaining context across time steps
(RNNs)

III. Fill in the Blanks with Correct Machine Learning Terminology

1. Regression ✅ is used to predict a continuous value based on one or more input features.
2. Clustering ✅ groups similar data points together based on their characteristics.
3. Classification ✅ is the main purpose of Logistic Regression.
4. Classification ✅ involves predicting labels from predefined categories.

IV. True or False Statements

1. Accuracy is the proportion of true results among the total number of cases examined. ✅ True
2. Precision is the ratio of correctly predicted positive observations to the total predicted positive
observations. ✅ True
3. Recall measures the proportion of actual positives that were correctly identified by the model. ✅
True
4. The F1 Score is the harmonic mean of Accuracy and Precision. ❌ False (F1 Score balances precision
and recall.)
5. Mean Absolute Error (MAE) measures the average of the absolute differences between predicted and
actual values. ✅ True
6. Root Mean Squared Error (RMSE) penalizes larger errors more than MAE because of the square
operation. ✅ True
7. R Squared score measures how well independent variables explain variance, and it ranges from -∞ to
1. ❌ False (R-Squared ranges from 0 to 1.)
8. Adjusted R Squared adjusts for the number of predictors in the model and prevents overfitting. ✅
True
9. Understanding independent variable contributions is important for model interpretation. ✅ True
10. Precision is more important than Recall when avoiding false negatives is critical. ❌ False (Recall is
more important in scenarios like medical diagnosis.)

V. Practical Assessment: Analyzing Student Performance Using Machine Learning


1. Install Required Python Libraries
bash

pip install pandas numpy seaborn scikit-learn matplotlib requests


2. Load Student Performance Dataset
python

import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt

# Load dataset
df = pd.read_csv("student_performance.csv")

# Display first few records


print(df.head())
3. Split Dataset into Train, Test, and Validation Sets
python

from sklearn.model_selection import train_test_split

# Define features and target variable


X = df[["study_hours", "attendance", "assignments_completed"]]
y = df["final_grade"]

# Split into train, test, and validation sets


X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2,
random_state=42)
X_train, X_val, y_train, y_val = train_test_split(X_train, y_train,
test_size=0.2, random_state=42)
4. Initialize and Train the Model
python

from sklearn.linear_model import LinearRegression


# Initialize model
model = LinearRegression()

# Fit training data


model.fit(X_train, y_train)

# Predict results
y_pred = model.predict(X_test)
5. Visualize Predictions
python

plt.scatter(y_test, y_pred, color="blue")


plt.xlabel("Actual Grades")
plt.ylabel("Predicted Grades")
plt.title("Actual vs Predicted Student Performance")
plt.show()
6. Analyze Evaluation Metrics
python

from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score

# Calculate performance metrics


rmse = np.sqrt(mean_squared_error(y_test, y_pred))
mae = mean_absolute_error(y_test, y_pred)
r2 = r2_score(y_test, y_pred)

print(f"RMSE: {rmse}")
print(f"MAE: {mae}")
print(f"R-Squared Score: {r2}")
7. Hyperparameter Tuning Using GridSearch
python

from sklearn.model_selection import GridSearchCV

# Define parameter grid


param_grid = {"fit_intercept": [True, False]}

# GridSearch for best parameters


grid_search = GridSearchCV(model, param_grid, cv=5)
grid_search.fit(X_train, y_train)

# Best parameters
print(grid_search.best_params_)
8. Apply Evaluation Metrics on Validation and Test Data
python

y_val_pred = model.predict(X_val)
y_test_pred = model.predict(X_test)

print("Validation RMSE:", np.sqrt(mean_squared_error(y_val, y_val_pred)))


print("Test RMSE:", np.sqrt(mean_squared_error(y_test, y_test_pred)))
9. Detect Overfitting and Underfitting
python

train_score = model.score(X_train, y_train)


test_score = model.score(X_test, y_test)

print("Training R-Squared:", train_score)


print("Test R-Squared:", test_score)

if train_score > test_score:


print("Potential Overfitting Detected")
else:
print("Model Generalizes Well")
Final Results

✅ Loaded dataset using Pandas, NumPy, and Scikit-Learn ✅ Split dataset into training, testing, validation
sets ✅ Trained model using Linear Regression ✅ Evaluated performance using RMSE, MAE, and R-
Squared ✅ Hyperparameter tuning applied using GridSearch ✅ Detected overfitting using R-Squared
scores

I. Multiple Choice Questions with Answers

1. The primary benefit of using a web application for model deployment is: ✅ B) Real-time interaction
with users ➝ Web applications allow users to interact with models in real-time.
2. Common format for model files is: ✅ C) TensorFlow SavedModel ➝ TensorFlow’s SavedModel
format is widely used for deploying ML models.
3. API stands for: ✅ A) Application Programming Interface ➝ APIs allow communication between
applications and machine learning models.
4. Common data format used for sending input data to APIs: ✅ C) JSON ➝ JSON is a widely used
format for transmitting structured data.
5. Model deployment method NOT used in ML: ✅ C) Data scraping ➝ Data scraping collects data from
web sources but is not a model deployment method.
6. Main purpose of tracking API requests: ✅ C) To assess model performance and response times ➝
API tracking helps monitor model accuracy and efficiency.
7. When is a mobile app suitable for model deployment? ✅ B) For users requiring offline access and
notifications ➝ Mobile applications provide accessibility with offline functionality.
8. Common HTTP response code for a successful API request: ✅ B) 200 ➝ HTTP 200 means the request
was successful.
9. Crucial factor for ensuring model compatibility with the existing system: ✅ C) Programming
language and framework ➝ Compatibility ensures smooth integration with applications.
10. Primary goal of integrating the model file into an application: ✅ C) To provide predictions or
insights ➝ The model helps generate predictions or business insights.
11. Common methods for delivering predictions: ✅ D) All of the above ➝ REST APIs, Batch Processing,
and Real-time Streaming are common methods.
12. Best method for large volumes of data without immediate predictions: ✅ B) Batch Processing ➝
Batch processing processes data periodically rather than in real-time.
13. Best-suited method for real-time applications like chatbots: ✅ C) REST APIs ➝ REST APIs allow
real-time interactions between users and models.
14. Key factors in choosing a prediction delivery method: ✅ E) All of the above ➝ Latency, data volume,
security, and cost are crucial considerations.
15. Role of APIs in delivering ML predictions: ✅ A) APIs enable clients to interact with the model
programmatically. ➝ APIs allow users to send requests and receive predictions dynamically.
II. Matching Machine Learning Deployment Terms
Column A (Term) Column B (Description)

1. Model Format ✅ B. h5, .pkl, .joblib, and .onnx formats

✅ A. Enables communication between the model and external


2. Role of APIs
applications

3. Libraries for Saving ML Models ✅ D. joblib and pickle

4. Cross-Platform Model Saving Framework ✅ C. ONNX

✅ G. Converts a model into a file or byte stream for storage and


5. Purpose of Serialization
transfer

6. Tool for Serving Models as REST APIs ✅ E. Flask or FastAPI

7. Model Deserialization ✅ F. Loading the saved model back into memory for inference

8. Environment Factors During Integration ✅ I. Python version, library versions, and dependencies

✅ J. Using the model.save() function to create .h5 or


9. Saving TensorFlow Model for Integration
SavedModel files

10. Platform for Deploying Containerized ML


✅ H. Docker
Models

III. True or False Statements

1. The main advantage of using a standalone program for model deployment is its ease of integration
with existing web applications. ✅ True
2. Scikit-Learn is a commonly used framework for deploying machine learning models. ✅ True
3. Monitoring performance involves tracking API requests, response times, and model accuracy. ✅
True
4. Batch processing is the only method available for deploying machine learning models. ❌ False (Real-
time streaming and REST APIs are also common.)
5. Proper formatting of predictions is unnecessary if the model is accurate. ❌ False (Formatted
predictions improve usability.)
6. Platforms offer high scalability and flexibility for deploying machine learning models. ✅ True
7. On-premise deployment provides the highest level of control over the model and its environment. ✅
True
8. Edge devices are typically used for high-latency applications where real-time processing is critical. ❌
False (Edge devices are used for low-latency applications requiring real-time predictions.)
9. Cost is a significant factor to consider when choosing a deployment method. ✅ True
10. Security is not a major concern when deploying machine learning models in the cloud. ❌ False
(Security is a critical factor when deploying models online.)

IV. Practical Assessment: Deploying a Real-Time Prediction Model


1. Install Required Libraries
bash
pip install pandas numpy flask joblib scikit-learn
2. Train a House Price Prediction Model
python

import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
import joblib

# Load dataset
df = pd.read_csv("house_prices.csv")

# Define features and target


X = df[["location_index", "square_footage", "num_rooms"]]
y = df["price"]

# Split dataset into train and test sets


X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2,
random_state=42)

# Train the model


model = LinearRegression()
model.fit(X_train, y_train)

# Save trained model


joblib.dump(model, "house_price_model.pkl")
3. Create an API Using Flask
python

from flask import Flask, request, jsonify


import joblib
import numpy as np

app = Flask(__name__)

# Load trained model


model = joblib.load("house_price_model.pkl")

@app.route('/predict', methods=['POST'])
def predict():
try:
# Get JSON request data
data = request.json
location_index = data["location_index"]
square_footage = data["square_footage"]
num_rooms = data["num_rooms"]

# Make prediction
prediction = model.predict([[location_index, square_footage,
num_rooms]])

return jsonify({"predicted_price": round(prediction[0], 2)})

except Exception as e:
return jsonify({"error": str(e)})
if __name__ == '__main__':
app.run(debug=True)
4. Test API with Sample Request
python

import requests

url = "http://127.0.0.1:5000/predict"
data = {"location_index": 3, "square_footage": 2000, "num_rooms": 4}
response = requests.post(url, json=data)

print(response.json())
5. Monitoring API Performance
python

from time import time


start_time = time()

response = requests.post(url, json=data)

end_time = time()
print("API Response Time:", end_time - start_time)
Final Features of the Deployment

✅ Trained house price prediction model ✅ Created API using Flask for real-time predictions ✅ Handled
errors to ensure smooth operation ✅ Tracked API performance to assess efficiency

PYTHON

I. Multiple Choice Questions with Answers

1. Which of the following is a feature of Python? Answer: ✅ c) Indentation-based syntax ➝ Python uses
indentation to define blocks of code instead of curly brackets {}.
2. Python was created by: Answer: ✅ a) Guido van Rossum ➝ Guido van Rossum developed Python in
the late 1980s, and it was officially released in 1991.
3. Which Python framework is known for rapid development and scalability? Answer: ✅ b) Django ➝
Django is a full-stack web framework used for scalable applications.
4. Python can be used for: Answer: ✅ d) All of the above ➝ Python supports web development, data
analysis, machine learning, and more.
5. Which IDE is specifically designed for scientific computing? Answer: ✅ c) Spyder ➝ Spyder is built
for Python's scientific computing ecosystem, including NumPy and SciPy.
6. Python is classified as a(n): Answer: ✅ b) Interpreted language ➝ Python code is executed line by line
by the interpreter instead of being compiled.
7. What is the default file extension for Python scripts? Answer: ✅ c) .py ➝ Python scripts typically end
with .py.
8. The command to install a Python package using pip is: Answer: ✅ b) pip install package_name ➝
pip is Python’s package manager used for installing libraries.
9. Which of the following is NOT a Python web framework? Answer: ✅ c) NumPy ➝ NumPy is used for
numerical computing, not web development.
10. In Python, indentation is used to: Answer: ✅ b) Define the scope of loops and functions ➝ Proper
indentation is required for defining blocks of code in Python.

II. Fill in the Blanks

1. Python is an ✅ interpreted language, meaning it executes code line by line.


2. The Python package manager is called ✅ pip.
3. Python relies on ✅ indentation to define the scope of loops, functions, and classes.
4. ✅ FastAPI is a popular Python framework for building APIs, known for its performance and ease of
use.
5. The Python library ✅ Pandas is used for data manipulation and analysis.
6. Python’s simple and readable syntax makes it especially beneficial for ✅ beginners.
7. The command pip list is used to ✅ display installed packages.
8. ✅ Kivy is a Python framework used for developing cross-platform mobile and desktop applications.
9. Python’s ✅ large community provides extensive support, documentation, and resources.
10. In Python, variables do not require an explicit ✅ data type declaration.
11. PyCharm and VS Code are examples of ✅ IDEs used for Python development.
12. The command rmdir /s myenv is used to ✅ delete a Python virtual environment.
13. Python supports both object-oriented and ✅ functional programming paradigms.
14. The Python library ✅ TensorFlow is widely used for machine learning and deep learning.
15. In Python, the import statement is used to ✅ include libraries.

III. Matching Questions

1. Matching IDEs with Features

Column A (IDE) Column B (Features)


a) PyCharm ✅ (ii) Intelligent code completion
b) Jupyter Notebook ✅ (iii) Interactive environment for data analysis
c) Thonny ✅ (i) Beginner-friendly interface
d) Visual Studio Code ✅ (iv) Lightweight and customizable

2. Matching Python Frameworks

Column A (Framework) Column B (Description)


a) Django ✅ (iii) Full-stack framework for web development
b) Flask ✅ (ii) Lightweight framework for small projects
c) FastAPI ✅ (iv) High-performance API framework
d) Kivy ✅ (i) Framework for cross-platform applications

3. Matching Python Libraries

Column A (Library) Column B (Application)


a) NumPy ✅ (i) Numerical computing
b) Pandas ✅ (ii) Data manipulation
c) Matplotlib ✅ (iii) Data visualization
Column A (Library) Column B (Application)
d) Scikit-learn ✅ (iv) Machine learning

Practical Assessment: Web Application Deployment

Steps to Set Up Python Development Environment

Since HHT LTD wants an online store with automated deployment and updates, follow these steps:

1. Install Python

bash

sudo apt update


sudo apt install python3
python3 --version

2. Install and Configure a Virtual Environment

bash

python3 -m venv env


source env/bin/activate

3. Install Web Framework (Django or Flask)

bash

pip install django flask

4. Initialize Django Project

bash

django-admin startproject hht_web


cd hht_web

5. Set Up Automated Deployment with GitHub Actions


o Create .github/workflows/deploy.yml

yaml

name: Deploy Application


on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Dependencies
run: |
pip install -r requirements.txt
- name: Deploy
run: |
python manage.py migrate
python manage.py collectstatic --noinput

6. Testing Deployment

bash

python manage.py runserver

7. Hosting the Application Online


o Use AWS, Heroku, or Netlify to host the Python web application.

Summary

✅ Python Tools Installed: Environment setup, framework installation, and package management. ✅ Configured
Automatic Deployment: GitHub Actions deploys updates automatically. ✅ Testing and Hosting: Verified using
Django development server and deployment tools.

I. Multiple Choice Questions

1. What is the correct syntax to create a list in Python? ✅ B) list = [1, 2, 3] ➝ Lists are defined using
square brackets [].
2. Which of the following is an immutable data type in Python? ✅ C) Tuple ➝ Tuples cannot be
modified once created.
3. What will the output of the following code be?

python

x = 5
y = 10
print(x > y)

Answer: ✅ B) False ➝ 5 is not greater than 10, so the result is False.

4. Which operator is used for exponentiation in Python? ✅ B) ** ➝ Example: 2 ** 3 results in 8.


5. Which keyword is used to define a function in Python? ✅ B) def ➝ Functions are defined using def
function_name():.
6. What does the 'break' statement do in a loop? ✅ B) Exits the loop ➝ break stops the loop
immediately.
7. How do you create a dictionary in Python? ✅ B) dict = {key: value} ➝ Dictionaries use curly brackets
{} with key-value pairs.
8. Which function is used to read a CSV file into a DataFrame using pandas? ✅ A) pd.read_csv() ➝
pd.read_csv("file.csv") loads a CSV file into a pandas DataFrame.
9. What will len([1, 2, 3]) return? ✅ B) 3 ➝ len() counts the number of elements in the list.
10. Which of the following is a built-in function in Python? ✅ A) print() ➝ print() outputs data to the
console.

II. Complete the Sentences

1. A ✅ function is a block of reusable code that performs a specific task in Python.


2. The ✅ == operator is used to compare two values for equality.
3. In Python, a ✅ loop allows you to iterate over a sequence.
4. A ✅ lambda function can take any number of arguments but can only have one expression.
5. The ✅ os module provides a way to use operating system-dependent functionality in Python.
6. A ✅ defaultdict is a dictionary subclass that provides a default value for a nonexistent key.
7. The ✅ break statement is used to exit the nearest enclosing loop in Python.
8. A ✅ tuple is an immutable collection that can hold a variety of object types.
9. The ✅ open function is used to read the contents of a text file.
10. A ✅ dictionary is a collection of key-value pairs where keys must be unique.

III. True or False Statements

1. A list in Python is immutable. ❌ False (Lists are mutable.)


2. A function in Python can return multiple values. ✅ True
3. The 'else' clause can be used with a 'for' loop. ✅ True
4. The pandas library is primarily used for file handling. ❌ False (Used for data manipulation.)
5. Sets in Python can contain duplicate elements. ❌ False (Sets store unique elements.)
6. The 'pass' statement in Python does nothing when executed. ✅ True
7. You can use the 'with' statement for file handling in Python. ✅ True
8. A frozen set is a mutable version of a set. ❌ False (Frozen sets are immutable.)
9. The 'elif' keyword is used to check multiple conditions in Python. ✅ True
10. Variables in Python do not require a declaration before use. ✅ True

IV. Matching Python Data Types


Data Type Description

A. List 2. Ordered, mutable collection ✅

B. Tuple 4. Ordered, immutable collection ✅

C. Dictionary 3. Key-value pairs ✅

D. Set 1. Unordered collection of unique elements ✅

V. Practical Assessment: Implementing a Shopping Cart in Python

Below is the Python implementation for the shopping cart system that stores data in a CSV file.

1. Install Required Dependencies


bash

pip install pandas


2. Python Shopping Cart System
python

import csv

class ShoppingCart:
def __init__(self):
self.cart = []

def add_item(self, item):


self.cart.append(item)
print(f"Added {item} to the cart.")

def remove_item(self, item):


if item in self.cart:
self.cart.remove(item)
print(f"Removed {item} from the cart.")
else:
print("Item not found in the cart.")

def empty_cart(self):
self.cart.clear()
print("Cart is now empty.")

def save_to_csv(self, filename="cart.csv"):


with open(filename, mode='w', newline='') as file:
writer = csv.writer(file)
writer.writerow(["Item"])
for item in self.cart:
writer.writerow([item])
print(f"Cart data saved to {filename}")

def display_cart(self):
if not self.cart:
print("Your cart is empty.")
else:
print("Shopping Cart Items:")
for item in self.cart:
print(f"- {item}")

# Example Usage
cart = ShoppingCart()
cart.add_item("Laptop")
cart.add_item("Headphones")
cart.display_cart()

cart.remove_item("Headphones")
cart.display_cart()

cart.save_to_csv()
cart.empty_cart()
cart.display_cart()
6. Explanation of Features

✅ Add Items: Adds products to the shopping cart ✅ Remove Items: Removes a specific product from the cart ✅
Empty Cart: Clears all items from the cart ✅ Store Data in CSV: Saves cart items in cart.csv for persistence
✅ View Cart: Displays current cart items

7. Sample Output
Added Laptop to the cart.
Added Headphones to the cart.
Shopping Cart Items:
- Laptop
- Headphones
Removed Headphones from the cart.
Shopping Cart Items:
- Laptop
Cart data saved to cart.csv
Cart is now empty.
Your cart is empty.
Final Notes

✅ Comprehensive Theoretical Assessment Answers ✅ Matching Questions for Data Types, Functions, and
Modules ✅ Complete Shopping Cart System Implementation in Python

Matching Terms with Definitions


Item Definition

1. Class A. A blueprint for creating objects. ✅

2. Object B. A specific instance of a class. ✅

3. Inheritance J. The mechanism of a class acquiring properties from another class. ✅

4. Polymorphism C. The ability to use a method in different ways. ✅

5. Encapsulation D. Restricting access to certain components of an object. ✅

6. Method G. A method that replaces the implementation of a method in the superclass. ✅

7. Constructor H. A special method used to initialize objects. ✅

8. Data Hiding I. The ability to hide data from outside access. ✅

9. Superclass E. A class from which another class inherits. ✅

10. Subclass F. A derived class that inherits properties from another class. ✅
II. Matching Python Libraries with Use Cases
Python Library Primary Use Case

1. Matplotlib C. Data visualization ✅

2. NumPy B. Numerical operations on arrays and matrices ✅

3. Pandas A. Data manipulation and analysis ✅

4. Ansible D. Automation and configuration management ✅

5. datetime E. Date and time handling ✅

III. Multiple Choice Questions

1. What keyword is used to define a class in Python? ✅ B) class


2. Which of the following allows a class to inherit properties from multiple classes? ✅ B) Multiple
Inheritance
3. What does the __init__() method do? ✅ B) It initializes an object's attributes.
4. What is the primary benefit of encapsulation? ✅ B) It hides the internal state of an object.
5. In Python, what is polymorphism primarily used for? ✅ B) To allow different classes to be treated as
instances of the same class.

IV. True or False Statements

1. An object is an instance of a class. ✅ True


2. In Python, all classes must inherit from a superclass. ❌ False (Not required.)
3. Encapsulation allows for direct access to an object's private attributes. ❌ False (Encapsulation
restricts access.)
4. Polymorphism can be achieved through method overloading. ✅ True
5. A subclass can override methods from its superclass. ✅ True
6. Inheritance promotes code reuse. ✅ True
7. The self keyword is used to refer to an instance of a class. ✅ True
8. All attributes in a class are public by default. ✅ True
9. The __str__() method is used to represent an object as a string. ✅ True
10. Method overloading is directly supported in Python. ❌ False (Python does not support method
overloading.)

V. Completing the Sentences


Correct
Sentence
Keyword

1. A class is a blueprint for creating objects in Python. ✅

2. The process of a class inheriting properties from another class is called inheritance . ✅

3. In Python, you use the keyword class to define a class. ✅


Correct
Sentence
Keyword

4. The constructor method is automatically called when an object is created. ✅

5. Method overriding allows a subclass to provide a specific implementation of a method


defined in its superclass. ✅

6. Data hiding is a feature of encapsulation that restricts direct access to some attributes. ✅

7. A object is an instance of a class. ✅

8. Inheritance allows for the creation of a hierarchical structure among classes. ✅

9. The ability to treat objects of different classes as objects of a common superclass is known as
polymorphism . ✅

10. Encapsulation is achieved when a subclass inherits methods and properties from a
superclass. ✅

VI. Practical Assessment: Health Management System in Python

Below is the implementation of the Health Management System for GIRUBUZIMA HOSPITAL using Object-
Oriented Programming (OOP) and Python libraries.

Step 1: Creating the Patient Class


python

import datetime

class Patient:
def __init__(self, name, age, gender, disease):
self.__name = name # Private attribute
self.__age = age
self.__gender = gender
self.__disease = disease
self.__admission_date = datetime.datetime.now() # Timestamp

# Getter methods to access private attributes


def get_details(self):
return f"Name: {self.__name}, Age: {self.__age}, Gender:
{self.__gender}, Disease: {self.__disease}, Admission Date:
{self.__admission_date}"

def calculate_days_since_admission(self):
return (datetime.datetime.now() - self.__admission_date).days
Step 2: Creating Specialized Classes (InPatient and OutPatient)
python

class InPatient(Patient):
def __init__(self, name, age, gender, disease, room_number):
super().__init__(name, age, gender, disease)
self.room_number = room_number
def get_details(self):
return super().get_details() + f", Room Number: {self.room_number}"

class OutPatient(Patient):
def __init__(self, name, age, gender, disease, appointment_date):
super().__init__(name, age, gender, disease)
self.appointment_date = appointment_date

def get_details(self):
return super().get_details() + f", Appointment Date:
{self.appointment_date}"
Step 3: Automating Post-Deployment Tasks Using Ansible

Ansible can automate service restarts and configuration updates. Create a playbook (deploy.yml):

yaml

- name: Health Management System Deployment


hosts: hospital_servers
tasks:
- name: Restart Health Management System
service:
name: health_system
state: restarted

- name: Update Configuration File


copy:
src: health_config.yaml
dest: /etc/health_system/config.yaml

Run the playbook:

bash

ansible-playbook deploy.yml
Step 4: Visualizing Patient Recovery Trends Using Matplotlib
python

import matplotlib.pyplot as plt

# Sample Data
days = [1, 5, 10, 15, 20]
recovery_scores = [30, 50, 70, 85, 95]

plt.plot(days, recovery_scores, marker='o', linestyle='--', color='r')


plt.xlabel('Days Since Admission')
plt.ylabel('Recovery Score')
plt.title('Patient Recovery Trends')
plt.show()
Final Features in the Health Management System

✅ Encapsulation: Private patient details for data protection. ✅ Inheritance: Specialized InPatient and
OutPatient classes. ✅ Time Handling: Admission timestamps aligned with Rwanda’s timezone. ✅ Data
Analysis: Tracks recovery tren

DevOPS AND SOFTWARE TESTING

DevOps, Quality,Project Requirement, Version Control

Q1. Circle the letter corresponding with the correct answer.

i. The main objective of DevOps is:


✅ Answer: b) To enhance collaboration between development and operations

👉 Explanation: DevOps focuses on removing silos and improving collaboration, automation, and continuous
delivery.

ii. CI/CD stands for:


✅ Answer: d) Continuous Integration / Continuous Deployment

👉 Explanation:

 CI (Continuous Integration): Automating the merging and testing of code.


 CD (Continuous Deployment): Automatically deploying tested code to production.

iii. One of the following statements describes “Infrastructure as Code” (IaC):


✅ Answer: b) Using code to define and manage infrastructure

👉 Explanation:
IaC allows managing servers and infrastructure through scripts or configuration files like Ansible, Terraform, etc.
iv. Which of the following is a version control system widely used in DevOps?
✅ Answer: A) Git

👉 Explanation: Git is a distributed version control system. Others like Docker and Kubernetes are used for
containers and orchestration, not version control.

Q2. Match the commands (column B) with their function (column C)

Answer
Command (B) Function (C)
(A)
1. B cd To change directory
Command used to shut down the system
2. D sudo shutdown now
immediately
3. E mkdir To create directory
4. C cat Used to display contents of files
5. I sudo Run commands with superuser privileges
6. J cp Command used to copy files and directories
7. G pwd Displays the current working directory (root path)
sudo systemctl restart service-
8. F Restart system services
name
Used to install packages on Debian-based Linux
9. A sudo apt install
systems

🧪 PRACTICAL ASSESSMENT – RWANDA NETWORK LTD

Scenario Summary:
Rwanda Network Ltd is upgrading from a Windows Server to a Linux Server for managing web services. You're
tasked to:

 Install Linux Server


 Configure Web Server services
 Test server functionalities

✅ STEPS TO COMPLETE THE TASK:

1. Install Linux Server

 Download and install Ubuntu Server or CentOS


 During installation:
o Set up hostname: rwanda-network-server
o Configure a strong root password
o Assign a static IP if needed

2. Configure Web Server Services (Apache)

bash
CopyEdit
# Step 1: Update the server
sudo apt update && sudo apt upgrade -y

# Step 2: Install Apache Web Server


sudo apt install apache2 -y

# Step 3: Enable and start Apache


sudo systemctl enable apache2
sudo systemctl start apache2

# Step 4: Confirm firewall allows web traffic


sudo ufw allow 'Apache'

# Step 5: Check server IP


ip a

# Step 6: Test in browser


# Access http://<your-server-ip>

3. Test Server Functionalities

 Open browser from a client in the network


 Enter the server IP (e.g., http://192.168.1.10)
 You should see the Apache2 Ubuntu Default Page
 Use ping, curl, or systemctl status apache2 to verify locally

Theoretical Assessment

Q1. Circle the correct answer on the following questions:

i. Which of the following is a tool commonly used for Continuous Deployment (CD)? (a.) Jenkins b. Ansible c.
SonarQube d. Git * Explanation: Jenkins is a widely used open-source automation server that can orchestrate the
entire CD pipeline, from building and testing to deploying applications. Ansible is primarily a configuration
management and orchestration tool, SonarQube focuses on code quality, and Git is a version control system.

ii. What is the primary role of a Continuous Integration (CI) server? a. Manage code repositories (b.) Automate the
building and testing of code c. Orchestrate server deployments d. Monitor system uptime * Explanation: The core
function of a CI server is to automatically build, test, and integrate code changes from multiple developers into a
shared repository frequently.

iii. Which of the following tasks is related to Continuous Integration (CI)? a. Implementing automated rollback b.
Developing deployment scripts (c.) Setting up automated builds d. Using infrastructure as code (IaC) *
Explanation: Setting up automated builds is a fundamental practice in CI, ensuring that code changes are compiled
and packaged automatically. Automated rollback and deployment scripts are more related to CD, while IaC supports
the infrastructure needed for both CI and CD.

iv. Which tool is best suited for deployment orchestration in Continuous Delivery (CD)? a. GitLab CI (b.)
Kubernetes c. Jenkins d. Travis CI * Explanation: Kubernetes is a powerful container orchestration platform
designed for automating the deployment, scaling, and management of containerized applications, making it highly
suitable for CD. While GitLab CI, Jenkins, and Travis CI can handle deployments, Kubernetes provides more
advanced orchestration capabilities for complex deployments.

v. What does Infrastructure as Code (IaC) allow you to do? (a.) Automate deployments using scripts b. Manage code
quality c. Track software versions d. Create CI pipelines * Explanation: Infrastructure as Code (IaC) involves
managing and provisioning infrastructure using machine-readable definition files, rather than manual configuration.
This enables the automation of infrastructure deployment and management.

vi. Which of the following is NOT a task in Continuous Delivery (CD)? (a.) Configure the CI pipeline b. Perform
code quality checks c. Implement automated rollback d. Use a deployment orchestration tool * Explanation:
Configuring the CI pipeline is a prerequisite for CD but is considered part of the CI process. CD focuses on
automating the release of software to various environments after the CI process is complete.

vii. Which of the following steps would you take when implementing a Continuous Integration (CI) pipeline? a.
Configure CD pipeline (b.) Set up an automated build process c. Develop deployment scripts d. Use deployment
orchestration tools * Explanation: Setting up an automated build process is a crucial first step in implementing a CI
pipeline. The other options are more related to the CD pipeline.

viii. Which feature of Continuous Deployment (CD) helps in minimizing disruptions and errors during deployment?
(a.) Automated rollback b. Infrastructure as Code (IaC) c. Code quality checks d. Artifact management *
Explanation: Automated rollback allows the system to automatically revert to a previous stable version in case of a
failed deployment, minimizing disruptions and errors for users.

Q2. Read carefully and then answer the following questions

i. Describe CI and CD tools. CI (Continuous Integration) tools are designed to automate the process of building,
testing, and integrating code changes from multiple developers frequently. Examples include Jenkins, GitLab CI,
Travis CI, and CircleCI. These tools monitor code repositories, automatically trigger builds upon new commits, run
automated tests, and provide feedback on the integration process.

CD (Continuous Delivery or Continuous Deployment) tools extend the CI process


by automating the release of software to various environments, including
production. Continuous Delivery focuses on ensuring that the software is
always in a deployable state, while Continuous Deployment goes a step further
by automatically deploying every code change that passes the automated tests
to production. Examples of CD tools include Jenkins (again, as it can
orchestrate the entire pipeline), Spinnaker, Argo CD, and deployment features
within CI platforms like GitLab CI and Azure DevOps Pipelines. Container
orchestration tools like Kubernetes and configuration management tools like
Ansible can also play a significant role in CD.

ii. What are the benefits of adopting DevOps approach? Adopting a DevOps approach offers numerous benefits,
including: * Faster Time to Market: Automation and streamlined processes lead to quicker software releases. *
Improved Collaboration: Breaking down silos between development and operations fosters better communication
and teamwork. * Increased Efficiency: Automation reduces manual tasks and errors, freeing up teams to focus on
innovation. * Enhanced Software Quality: Continuous testing and feedback loops lead to more stable and reliable
software. * Greater Agility: DevOps enables organizations to respond more quickly to changing market demands
and customer needs. * Reduced Operational Costs: Automation and efficient resource utilization can lower
operational expenses. * Improved Customer Satisfaction: Faster releases and higher quality software contribute to
better user experiences. * Increased Innovation: By reducing the overhead of deployments and operations, teams
can dedicate more time to developing new features.

iii. How does DevOps promote collaboration between development and operation teams? DevOps promotes
collaboration through several key principles and practices: * Shared Goals and Responsibilities: DevOps
encourages a culture where development and operations teams share common goals and are jointly responsible for
the entire software lifecycle. * Open Communication and Feedback: Regular communication, feedback loops, and
shared tools facilitate better understanding and alignment between teams. * Automation: Automating processes like
building, testing, and deployment reduces friction and dependencies between teams. * Cross-Functional Teams:
DevOps often involves organizing teams with members from both development and operations, fostering direct
collaboration. * Shared Ownership: Both teams take ownership of the entire product lifecycle, from development
to deployment and maintenance. * Empathy and Understanding: DevOps encourages team members to
understand the challenges and perspectives of their counterparts in the other team.

iv. What are the challenges that organizations might face when implementing DevOps? Implementing DevOps
can present several challenges: * Cultural Resistance: Overcoming traditional silos and resistance to change can be
difficult. * Skill Gaps: Teams may lack the necessary skills in areas like automation, cloud technologies, and cross-
functional collaboration. * Tool Sprawl and Integration: Choosing and integrating the right set of tools can be
complex and overwhelming. * Organizational Structure: Adapting the existing organizational structure to support
DevOps principles may require significant changes. * Security Concerns: Integrating security practices early in the
development lifecycle (DevSecOps) requires a shift in mindset and processes. * Measuring Success: Defining and
tracking the right metrics to demonstrate the value of DevOps can be challenging. * Initial Investment:
Implementing DevOps often requires investment in new tools, training, and infrastructure. * Maintaining
Momentum: Sustaining the DevOps transformation and ensuring continuous improvement requires ongoing effort
and commitment.

Practical Assessment

This section describes a practical scenario and doesn't require a direct answer in the same format as the theoretical
questions. However, it outlines a common set of tasks for a full-stack developer in a DevOps environment:

 Stepping up the project: This likely involves understanding the project goals, architecture, and existing
infrastructure.
 Containerizing the application: This would involve creating a Dockerfile to package the application and
its dependencies into a container image.
 Deploying the application using a CI/CD pipeline: This would entail setting up or modifying a CI/CD
pipeline (e.g., in Jenkins, GitLab CI, or GitHub Actions) to automatically build the container image, run
tests, and deploy it to the target environment (likely using a container orchestration platform like
Kubernetes or Docker Swarm).
 Performing data migration to a new database system: This would involve planning and executing a
strategy to move data from the old database to the new one, ensuring data integrity and minimal downtime.
This might involve writing migration scripts and coordinating the switchover within the deployment
pipeline.

Q1. Read carefully and answer the following questions:

i. What factors should be considered when selecting and installing monitoring tools?
✅ Answer:
 Compatibility with infrastructure
 Scalability
 Real-time alerting capabilities
 Integration with other tools (CI/CD, ticketing, dashboards)
 Ease of use and installation
 Cost and licensing model
 Community or vendor support

ii. What are the key benefits of effective DevOps monitoring?


✅ Answer:

 Early detection of issues


 Improved system reliability and uptime
 Enhanced performance tuning
 Better user experience
 Faster incident response and recovery
 Continuous feedback into the development cycle

iii. What are the different types of monitoring tools used in DevOps environments?
✅ Answer:

 Infrastructure monitoring tools (e.g., Prometheus, Nagios)


 Application performance monitoring (APM) (e.g., New Relic, Dynatrace)
 Log monitoring tools (e.g., ELK stack, Splunk)
 Network monitoring tools (e.g., Zabbix, SolarWinds)
 Synthetic monitoring tools (e.g., Pingdom)

iv. What factors should be considered when selecting and installing monitoring tools?
✅ Answer (repetition of i):
Same as above – emphasize integration, performance impact, usability, and alerting features.

v. What is the importance of integrating feedback loops into the DevOps process?
✅ Answer:

 Enables continuous improvement


 Helps identify user pain points
 Supports quick iterations and refinements
 Improves overall product quality
 Ensures user and stakeholder needs are met
Q2. Circle the letter corresponding with correct answer:

i. What is the primary purpose of performance metrics in DevOps?


✅ Answer: C. To monitor the performance of systems and applications

ii. Feedback data is essential in DevOps for:


✅ Answer: B. Understanding user experiences

iii. Why is data analysis crucial in DevOps?


✅ Answer: A. To identify areas for improvement

iv. Data analysis can help DevOps teams:


✅ Answer: A. Optimize resource utilization

v. Which of the following is NOT a type of data commonly used in DevOps?


✅ Answer: B. Financial data

vi. Monitoring tools are used to collect:


✅ Answer: C. System metrics

vii. Regular review of performance data helps DevOps teams:


✅ Answer: A. Identify trends and anomalies

viii. Root cause analysis is used to:


✅ Answer: D. Identify the underlying causes of performance issues

ix. Feedback loop integration involves:


✅ Answer: A. Collecting and analyzing feedback from users
Q3. Answer by using letter T if the statement is True and use letter F if the statement is False.
Statement Answer

a. Report findings should be presented in a clear and concise manner, using graphs, charts, and tables
T
where appropriate

b. Trends analysis can help identify patterns and anomalies in performance data T

c. Alerts and incidents should be documented in detail, including the time, date, and severity of the event T

d. It is not necessary to investigate the root cause of alerts and incidents F

e. Action items should be specific, measurable, achievable, relevant, and time-bound T

🧪 PRACTICAL ASSESSMENT – MONITORING ENVIRONMENT SETUP

Scenario:
You are tasked with setting up a monitoring environment for a web application running on cloud infrastructure.
You need to:

 Install & configure a monitoring tool


 Track KPIs: CPU usage, memory usage, response time, and error rates
 Generate a report on work done

✅ STEPS TO COMPLETE THE TASK:

1. Install and Configure Prometheus + Grafana (Example Monitoring Stack)


📌 Install Prometheus
bash
CopyEdit
# Update and install dependencies
sudo apt update && sudo apt install wget tar -y

# Download Prometheus
wget
https://github.com/prometheus/prometheus/releases/download/v2.51.1/prometheus
-2.51.1.linux-amd64.tar.gz

# Extract and move


tar xvf prometheus-2.51.1.linux-amd64.tar.gz
sudo mv prometheus-2.51.1.linux-amd64 /etc/prometheus

# Run Prometheus
cd /etc/prometheus
./prometheus --config.file=prometheus.yml
📌 Install Grafana
bash
CopyEdit
sudo apt install -y software-properties-common
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable
main"
sudo apt update && sudo apt install grafana -y

# Start Grafana
sudo systemctl start grafana-server
sudo systemctl enable grafana-server

2. Configure Monitoring for KPIs

 Add Node Exporter to Prometheus targets for CPU, memory, and disk
 Connect Grafana to Prometheus as a data source
 Create dashboards to display:
o CPU usage
o Memory usage
o Web response times (via blackbox_exporter)
o Error rates (HTTP 4xx/5xx)

3. Generate Report

Create a report that includes:

 Monitoring tool used: Prometheus, Grafana


 KPIs tracked: CPU, memory, response time, errors
 Dashboard screenshots
 Summary of findings from testing the app under normal and stress conditions
 Recommendations for alerting thresholds

Project Requirement

📝 Theoretical Assessment

Question 1: Match Key Terms to Their Meanings

Answer Key Term Meaning


a) 3 a) Customer 3. Referred to as a client, a person/organization that buys products.
b) 4 b) User story 4. What the user wants to achieve with the product.
c) 1 c) Communication channel 1. Medium or pathway for transmitting information.
d) 2 d) Customer pain point 2. Shortcoming that discourages a customer from purchasing.
Question 2: True or False Statements

a) Involving clients during interviews is important to collect specific requirements.


✅ Answer: True – Clients provide real needs and expectations.

b) Questionnaires are used only when few people are involved.


❌ Answer: False – They are better for many people to save time.

c) Gestures are not allowed in communication.


❌ Answer: False – Gestures are part of non-verbal communication and help clarify meaning.

d) Graphics can be used when interpreting data.


✅ Answer: True – They help make complex data easy to understand.

Question 3: Why is feedback important? (Tick two correct answers)

☑ Confirmation of Receipt – So the sender knows the message was received.


☑ Encourages Open Communication – It builds trust and promotes discussion.
✗ Reduce errors in typing – Not directly related to feedback.
✗ Encourage receiver to encode – Not a common reason for giving feedback.

Question 4: True or False – Types of Communication

a) Email is a verbal communication.


❌ Answer: False – Email is written.

b) Voice chat on WhatsApp is verbal.


✅ Answer: True – You speak with your voice.

c) Showing a graphic to a customer is visual communication.


✅ Answer: True – It's seen, not spoken or written.

d) A printed report is written communication.


✅ Answer: True – It uses written words.

Question 5: Matching Data Terms


Term Correct Match and Explanation

Data Manipulation (not clearly given) – Editing, sorting, and organizing data.

Qualitative Data b. Non-numeric info like opinions, images, or audio.

Data Visualization d. Presenting data using graphs/charts.


Term Correct Match and Explanation

Quantitative Data a. Numeric info like sales figures or measurements.

Question 6: Which one is NOT a data category?

Answer: c) Cloud data – Cloud is where data is stored, not a category of data.

Question 7: Fill in the Blank

The process of finding and fixing errors in data is called:


✅ Answer: a) Data cleansing

Question 8: Which is NOT part of a data report?

✅ Answer: b) Acknowledgement – It's used in formal reports like research, but not in regular data analysis
reports.

🧪 PRACTICAL ASSESSMENT – EXPLANATION WITH STEPS

Scenario: KGD Innovation wants to attract more pet food customers using a website.
You are hired to collect, interpret, and report data in 4 hours.

1. Collect Data

Use these tools:

 Interview KGD workers or nearby farmers.


 Survey with questions like:
o Do you know KGD sells pet food?
o How do you usually buy pet food?
o Would a website help you access products?

2. Interpret Data

Group answers to understand:

 How many people know about KGD?


 Which areas have the most demand?
 What challenges people face (e.g., distance, no delivery)?
3. Organize & Report Findings

Report Structure Example:

Title: Market Research Report for KGD Innovation

 Introduction – Explain the purpose: improve customer reach


 Objective – Help the company reach remote farmers
 Method – Data from 10 interviews, 20 survey responses
 Findings – 70% unaware of KGD, 80% want online access
 Conclusion – Website will solve visibility and access
 Recommendations – Build website, promote on social media, add delivery service

✅ THEORETICAL ASSESSMENT – WITH ANSWERS & EXPLANATIONS

Question 1: Match the key terms to their meanings

Answer Key Term Meaning


a) 3 a) Customer 3. A person or organization that buys a product or service.
b) 4 b) User story 4. A short sentence describing what the user wants to do with the product.
c) 1 c) Communication channel 1. A method for transferring information (e.g., email, phone, face-to-face).
d) 2 d) Customer pain point 2. A problem a customer experiences that needs solving.

👉 Understanding: This question helps you learn key terms used in requirements analysis and communication.

Question 2: True or False

Statement Answer Explanation


a. Clients must be involved in interviews to get Involving clients ensures you gather accurate and
specific requirements. ✅ True complete requirements.

b. Questionnaires are used only when analysts need ❌ Questionnaires are useful for many people due to time
info from a few people. False efficiency.
c. Gestures are not allowed during communication ❌ Gestures are part of non-verbal communication and
with customers. False help support understanding.
Visual aids like charts help make data easier to
d. Graphics may be used when interpreting data. ✅ True
understand.

Question 3: Why is feedback important? (Choose two)

✅ Confirmation of Receipt
✅ Encourages Open Communication
❌ Reduce errors in typing
❌ Encourage receiver to encode a short message

👉 Understanding: Feedback ensures the message is received and builds trust between sender and receiver.

Question 4: Communication Types (True or False)

Statement Answer Explanation


❌ Email is written
a) Sending an email to a customer is verbal communication.
False communication.
b) Voice chat on WhatsApp is a form of verbal communication. ✅ True It's spoken, so it’s verbal.
Graphs and charts are visual
c) Presenting data using graphics is a form of visual communication. ✅ True
tools.
d) Sharing a printed report with your customer is a kind of written
communication. ✅ True Reports use written text.

Question 5: Match data interpretation terms

Term Correct Meaning


1. Data Manipulation Changing data values, format, or structure. (Not provided explicitly in choices)
2. Qualitative Data b. Non-numeric data (e.g., opinions, images, text).
3. Data Visualisation d. Graphical representation of data.
4. Quantitative Data a. Numeric data (e.g., sales figures, measurements).

Question 6: Which one is NOT a category of data?

✅ Answer: c) Cloud data

👉 Explanation: Cloud data refers to storage location, not a data type. Types of data include:

 Numerical
 Categorical
 Image

Question 7: Fill in the blank

"…………………………… is the process of finding and removing errors from data."


✅ Answer: a) Data cleansing

👉 Explanation: Data cleansing improves data quality by fixing issues like duplicates or missing values.
Question 8: Which is NOT an element of a data report?

✅ Answer: b) Acknowledgement

👉 Explanation: Elements of data reports usually include:

 Introduction
 Objective
 Data collection methods
"Acknowledgement" is typically used in formal papers, not regular reports.

🧪 PRACTICAL ASSESSMENT – EXPLAINED TASKS

Scenario:
KGD Innovation sells pet food but has few customers due to lack of awareness. They want to build a website. You
are the analyst assigned.

🧪 Task 1: Collect data about KGD Innovation

How:

 Interview workers and managers (e.g., what products they sell, who their customers are).
 Survey nearby farmers (e.g., do they know about KGD? Would they use a website?).

🧪 Task 2: Interpret collected data

What to look for:

 Common responses and patterns (e.g., 70% of farmers don't know about KGD).
 Specific needs (e.g., demand for delivery or online ordering).

🧪 Task 3: Organize and report findings

How to structure your report:

Title: Market Report for KGD Innovation

1. Introduction – Purpose of the study.


2. Objective – Increase customer awareness using a website.
3. Methodology – 10 interviews + 20 survey responses.
4. Findings – 75% unaware of KGD; most prefer online access.
5. Conclusion – KGD must build a website.
6. Recommendations – Develop website, use local social media, offer delivery.
✅ THEORETICAL ASSESSMENT – WITH ANSWERS & EXPLANATIONS

Question 1:

………………… is a concise, informal description of a specific feature or functionality from the perspective of
an end user or customer.

✅ Answer: b) User story

👉 Explanation:
A user story is a brief statement that describes a feature from the perspective of the end user, typically in the
format:
As a [role], I want [goal] so that [benefit].

Question 2: Tick the parts of a user story

✅ Answer: All the above

 ☑ Customer
 ☑ User
 ☑ Role
 ☑ Objective
 ☑ Benefit
 ✅ All the above

👉 Explanation:
All listed elements are involved in building a complete user story, especially Role, Objective, and Benefit which
form the core of user story writing.

Question 3: True or False

Statement Answer Explanation


1. A project backlog is a prioritized list of all the work items that This is the exact definition of a project
✅ True
need to be completed. backlog.
2. A project backlog will have no end date and be used Backlogs evolve continuously in agile
✅ True
continuously throughout the product lifecycle. projects.
3. The project backlog is typically managed by the product These roles handle prioritizing and
owner or project manager. ✅ True maintaining the backlog.

Question 4: The following list includes elements of project backlog except:

✅ Answer: Role
👉 Explanation:
A Role is part of a user story, not a direct element of the backlog itself.
Project backlog typically includes:

 Identifier
 User story
 Priority
 (Other elements like estimates, acceptance criteria, etc.)

Question 5: The use of sitemap is to:

✅ Answer: a) Serves as a navigational aid by outlining the website's structure and helps users find
information.

👉 Explanation:
A sitemap helps both users (HTML sitemap) and search engines (XML sitemap) understand the website’s layout.

Question 6: Differentiate XML from HTML sitemap

Characteristics XML HTML


Intended for search engines ✅
Intended for users ✅
Helpful for providing a structured list of links ✅ ✅
Able to include URLs in any order ✅
Not designed for human readability or navigation ✅

👉 Explanation:

 XML sitemaps help search engines crawl and index the site.
 HTML sitemaps help users navigate the site more easily.

Question 7: True or False

Statement Answer Explanation


a) Task flow is a representation of the steps and interactions a Task flows visualize user actions and
✅ True
user takes to accomplish a specific goal. system responses.
Helps designers identify and fix pain
b) A well generated task flow covers users’ pain points. ✅ True
points in the user journey.
Site structure planning impacts how
c) Site map informs the design and development process ✅ True content is designed and coded.
d) It maps out the sequence of actions and screens that a user A task flow outlines the full process of
✅ True
encounters. completing a task.
🧪 PRACTICAL ASSESSMENT – KABONA TSS

Scenario Summary:

KABONA TSS is implementing a Student Information Management System (MIS). Requirements are already
collected. The analyst must now:

 Create a sitemap
 Generate a task flow

✅ a) Site Map for Student MIS

pgsql
CopyEdit
Home
├── Dashboard
│ ├── Notifications
│ └── System Status
├── Students
│ ├── Register New Student
│ ├── View All Students
│ └── Search Student
├── Classes
│ ├── Assign Students to Class
│ └── View Class List
├── Attendance
│ ├── Daily Attendance
│ └── Attendance Reports
├── Grades
│ ├── Enter Grades
│ └── View Grade Reports
├── Reports
│ ├── Student Performance
│ ├── Attendance Summary
│ └── Export to PDF/Excel
├── Settings
│ ├── User Roles
│ ├── System Configuration
│ └── Logout

✅ b) Task Flow: Register a New Student

text
CopyEdit
Start

Login to System

Navigate to “Students” → “Register New Student”

Fill in student form (Name, DOB, Class, Contact Info, etc.)

Validate Data

Click “Save”

System stores student data in the database

Confirmation Message: “Student Registered Successfully”

Redirect to Student List Page

End

Version Control

Git Assessment - Answers and Explanations

Theoretical Assessment

1. Match the Git branch operations with their corresponding commands:

 Operation: Create branch


o Command: a. git branch <branch-name>
o Explanation: This command creates a new branch pointer based on your current commit, but
doesn't switch to it.
 Operation: List branch
o Command: b. git branch
o Explanation: This command lists all local branches in your repository. The current branch is
usually marked with an asterisk (*).
 Operation: Delete local branch
o Command: c. git branch -d <branch-name>
o Explanation: This command deletes the specified local branch. It's safer (-d) as it prevents
deletion if the branch hasn't been merged. Use -D to force delete.
 Operation: Delete remote branch
o Command: d. git push origin --delete <branch-name>
o Explanation: This command tells the remote repository (commonly named 'origin') to delete the
specified branch.
 Operation: Switch branch
o Command: e. git checkout <branch-name>
o Explanation: This command switches your working directory to the specified branch. Note: git
switch <branch-name> is a newer, more specific command for this purpose.
 Operation: Rename branch
o Command: f. git branch -m <old-branch-name> <new-branch-name>
o Explanation: This command renames a local branch. If you're on the branch you want to rename,
you can omit <old-branch-name>.

2. Complete the sentence:


I. Before staging a file, you must check all modified files and untracked files. * Explanation: You typically use
git status to see which files have changes (modified) or are new (untracked) before deciding what to stage
using git add. II. To create a new branch in Git, you use the command git **branch** <branch-name>.
* Explanation: As seen in question 1, git branch <name> creates the branch. III. To list all branches in a Git
repository, you use the command git **branch**. * Explanation: As seen in question 1, git branch lists
local branches. IV. To delete a local branch, you use the command git **branch -d** <branch-name>. *
Explanation: As seen in question 1, git branch -d <name> deletes a local branch safely. V. To delete a
remote branch, you use the command git **push** origin --delete <branch-name>. *
Explanation: As seen in question 1, deleting a remote branch involves pushing a delete instruction to the remote. VI.
To switch to a different branch, you use the command git **checkout** <branchname>. * Explanation:
As seen in question 1, git checkout <name> (or the newer git switch <name>) changes your active
branch. VII. To rename a branch, you use the command git **branch -m** <old-branch-name>
<newbranch-name>. * Explanation: As seen in question 1, git branch -m ... renames a branch.

3. How do I add files to a commit?

 Correct Answer: $ git add


o Explanation: In Git, committing is a two-step process. First, you use git add to stage the files
(add them to the index), indicating which changes you want to include in the next commit. Then,
you use git commit. So, git add is the command to add files to be included in a commit.

4. How to save the current state of your code in git?

 Correct Answer: By validating the modifications staged with $ git commit


o Explanation: "Saving the state" in Git means creating a commit, which is a snapshot of your
staged changes in the repository's history. You stage changes with git add and then finalize
(save) them into the history with git commit.

5. Read the Following statement and answer by true if correct or false otherwise

 a. The git add command is used to stage changes for the next commit.
o Answer: True
o Explanation: This is the primary purpose of git add.
 b. The git add command can be used to stage both new files and modifications to existing files.
o Answer: True
o Explanation: git add stages changes regardless of whether the file is new (untracked) or
already tracked and modified.
 c. The git commit command is used to permanently save changes to the local repository.
o Answer: True
o Explanation: Commits record the staged snapshots into the repository's history.
 d. The git commit command requires a commit message to be provided.
o Answer: True
o Explanation: Git requires a message to describe the changes made in the commit, promoting
clarity and history tracking.
 e. The git commit command can be used to merge branches in Git.
o Answer: False
o Explanation: The command specifically used for merging branches is git merge. While
completing a merge often automatically creates a merge commit, the git commit command
itself doesn't initiate or perform the merge operation.

Practical Assessment
This section describes a standard Git workflow scenario illustrating the commands covered in the theoretical
questions. It shows the practical application of:

1. Repository initialization (implied, git init).


2. Branch creation (git branch feature_branch).
3. Making file changes (editing new_file.txt).
4. Checking status (implied, git status).
5. Staging changes (git add new_file.txt).
6. Committing changes (git commit -m "Add new_file.txt").
7. Switching branches (git checkout main - assuming 'main' is the default branch).
8. Merging branches (git merge feature_branch).
9. Conflict resolution (if necessary).
10. Deleting a merged branch (git branch -d feature_branch).

Okay, here are the answers and explanations for the second set of Git assessment questions, formatted for easy
copying into a Word document.

Git Assessment - Part 2: Answers and Explanations

Theoretical Assessment

1. Which of these Git client commands creates a copy of the repository and a working directory in the client’s
workspace?

 Correct Answer: c) clone


 Explanation: The git clone <repository_url> command is used to create a complete local copy
(clone) of a remote repository, including its history and a working directory with the latest version of the
files.

2. True or False? In Git, if you want to make your local repository reflect changes that have been made in a
remote (tracked) repository, you should run the pull command.

 Correct Answer: a) True


 Explanation: The git pull command fetches changes from the specified remote repository and
immediately attempts to merge them into your currently checked-out local branch. This updates your local
repository and working directory with the remote changes.

3. Now, imagine that you have a local repository, but other team members have pushed changes into the
remote repository. What Git operation would you use to download those changes into your working copy?

 Correct Answer: d) pull


 Explanation: As explained above, git pull is the command that fetches changes from the remote
repository and merges them into your local working copy, bringing your local environment up-to-date with
the remote.

4. Fill-in-the-blank space related to fetching, pulling, and pushing files in Git

a) To fetch changes from a remote repository without merging them into your local branch, you use the command
git **fetch**. * Explanation: git fetch downloads remote objects and refs but doesn't modify your local
working state. b) To fetch changes from a remote repository and merge them into your local branch, you use the
command git **pull**. * Explanation: git pull combines git fetch and git merge into one
command. c) To upload your local repository changes to a remote repository, you use the command git
**push** origin <branch-name>. * Explanation: git push sends your committed local changes to the
specified remote repository and branch. d) To see the status of your local repository, including which branch you are
on and any changes that are staged for commit, you use the command git **status**. * Explanation: git
status shows the state of the working directory and the staging area. e) To add all changes in your working
directory to the staging area, you use the command git **add .**. * Explanation: git add . stages all new,
modified, and deleted files in the current directory and its subdirectories. f) To commit your staged changes with a
message, you use the command git **commit** -m "Your commit message". * Explanation: git
commit records the staged changes into the repository history. The -m flag allows you to provide the commit
message inline. g) To create a connection to a new remote repository, you use the command git remote
**add** <name> <URL>. * Explanation: git remote add associates a name (e.g., 'origin', 'upstream') with
a remote repository's URL. h) To view the details of your remote repository connections, you use the command git
remote **-v**. * Explanation: git remote -v (verbose) lists the names of your remote connections along
with their URLs.

5. Match the operations with corresponding commands

 Operation: Fetch changes from remote repository


o Command: a. git fetch
 Operation: Fetch and merge changes from remote
o Command: b. git pull
 Operation: Push changes to remote repository
o Command: c. git push origin <branch-name>
 Operation: See the status of the local repository
o Command: d. git status
 Operation: Add all changes to the staging area
o Command: e. git add .
 Operation: Commit staged changes with a message
o Command: f. git commit -m "Your commit message"
 Operation: Create a connection to a remote repo
o Command: g. git remote add <name> <URL>

Practical Assessment

This scenario describes a collaborative software development workflow using Git to manage a bug fix:

1. Branching: Alex creates a separate branch (implied command: git checkout -b <branch-
name>) to work on the bug without disrupting the main codebase.
2. Committing & Pushing: Alex makes changes, commits them locally (git commit -m "..."), and
pushes the branch to the remote repository (git push origin <branch-name>) to back up the
work and make it visible to others.
3. Simulating & Merging Updates: Alex simulates client updates and merges them into the feature branch
(git merge <source-branch>), likely to test the fix against newer code or reproduce the bug under
specific conditions.
4. Collaboration (Fetching & Merging): Sarah works on related changes, pushes her branch (git push).
Alex then fetches Sarah's changes (git fetch origin <sarah-branch-name>) and merges them
into his own branch (git merge origin/<sarah-branch-name>) to integrate her contributions.
5. Git and Version Control System Assessment with Answers
6. 1. True or False
7.
a. Version control systems (VCS) track changes to files over time, enabling collaboration and version
history. - True
b. Distributed version control systems (DVCS) allow each user to have a complete copy of the repository
with its full history. - True
c. Branching in version control allows developers to work on separate features or fixes without interfering
with the main codebase. - True
d. Merging in version control combines changes from one branch or fork into another, integrating
separate lines of development. - True
e. Commits in version control systems are snapshots of the entire project at a specific point in time,
including all tracked files. - True
f. git pull fetches changes from a remote repository and merges them into the local repository. - True
g. git status displays information about the current state of the repository, such as modified files and
branch status. - True
h. git branch is used to create, list, delete, or manipulate branches in a Git repository. - True

8. 2. Match Git Commands with Their Descriptions


9.
Git Commit - Records changes to the repository
Git Clone - Copies a repository from a remote source to your local machine
Git Push - Uploads local repository content to a remote repository
Git Pull - Fetches and merges changes from a remote repository to your local repository
Git Remote - Manages connections to remote repositories
Git Status - Shows the current state of the repository, including tracked/untracked files and changes
Git Config - Sets configuration options for Git on your local machine
Git rm - Removes files from the working directory and stages the removal for the next commit

10. 3. Fill in the Blanks


11.
1. The command git branch is used to create a new branch in Git.
2. A Git reference is a pointer to a specific commit in the repository's history.
3. git checkout branch-name is used to switch between branches in Git.
4. To list all branches in a Git repository, you can use git branch -a.
5. A Git clone is a copy of a repository that lives on your computer instead of on a website's server.
6. git merge branch-name is used to integrate changes from one branch into another.
7. git remote add is used to manage connections to remote repositories.
8. git push origin branch-name is used to push the changes of the current branch to a remote repository.
9. A centralized version control system offers a way to collaborate using a central server.
10. Distributed version control system allows flexible management branching and merging.
12. 4. True or False about Git Bash
13.
a) Git bash is one among version control system that exist - False
b) Git init is used to clone remote repository - False
c) Git status is used to initialize an empty repository - False
d) In git you can view untracked files by using git version command - False

14. 5. Practical Assessment Task


15.
Task:
- Create a remote repository on GitHub using your full name as the repository name.
- Clone the repository to your local computer using `git clone`.
- Within the repository, create the required HTML forms:
├── login.html
├── student_registration.html
├── course_registration.html
├── book_registration.html
├── README.md
└── .gitignore
- Use Git commands to add, commit, and push your changes.

Quality Assurance

Software Testing Assessment - Answers and Explanations

Theoretical Assessment

Q1. What is software testing?

Software testing is the process of evaluating and verifying that a software product or application does what it 1 is
supposed to do. It involves executing software components using manual or automated tools to evaluate one or more
properties of interest. The 2 primary goals of software testing are to identify defects (errors or bugs), ensure the
software meets specified requirements and user expectations, measure quality, and provide stakeholders with
information to make informed decisions about the software's release.

Q2. Match the following terms in column A with their corresponding descriptions column B.

Column C
Column A Column B
(Answer)
1. Description of test plan A. The process of identifying and selecting appropriate test tools B
B. A document outlining the scope, objectives, and approach for
2. Identify test tools A
testing a software product
3. Identify test techniques C. The process of creating specific test cases to execute E
D. The process of defining the criteria that will determine if a test is
4. Identify test cases C
successful or failed
E. The process of defining the specific methods and procedures that
5. Identify test criteria D
will be used to conduct testing
F. The process of assigning personnel, equipment, and other resources
6. Allocate resources F
needed for testing
G. The process of creating a timeline for completing the testing
7. Prepare Test Data I
process
8. Prepare Test Execution H. The process of creating detailed instructions for executing test
H
Scripts cases
9. Schedule test delivery I. The process of creating or obtaining data that will be used during
G
plan testing
Export to Sheets

Q3. Circle the letter corresponding with the correct answer

1. Which of the following test techniques is most suitable for regression testing in a large-scale software
system?
o Correct Answer: b) Automated Testing
o Explanation: Regression testing involves re-running tests to ensure that recent code changes
haven't negatively impacted existing functionality. In large systems, this involves many repetitive
tests, making automation the most efficient and reliable approach.
2. What is the main advantage of using automated testing over manual testing?
o Correct Answer: c) Automated tests can be run repeatedly with less
effort and in less time.
o Explanation: Automation excels at executing repetitive test suites quickly and consistently,
reducing manual effort, saving time, and improving test coverage frequency, especially for
regression tests.
3. In which scenario would you typically choose parallel testing?
o Correct Answer: a) To verify that new software versions perform
consistently with the old version.
o Explanation: Parallel testing involves running two versions of a system (e.g., old and new)
simultaneously with the same inputs to compare their outputs and behaviour, ensuring the new
version maintains consistency or achieves expected changes.

Q4. Read the Following statement and answer by true if correct or false otherwise

a) Preparation of a testing environment involves setting up both hardware and software infrastructure. * Answer:
True * Explanation: A test environment requires the necessary hardware (servers, devices, network equipment) and
software (OS, databases, application builds, test tools) configured correctly. b) Hardware infrastructure is not
essential for testing as most testing is done on virtual environments. * Answer: False * Explanation: While virtual
environments are common, hardware is often essential, especially for testing hardware interaction (like medical
devices), performance under realistic loads, specific OS/device compatibility, or when virtualization doesn't
perfectly mimic the production hardware behaviour. c) Proper preparation of a testing environment helps prevent
configuration-related issues during testing. * Answer: True * Explanation: A well-defined and consistently
configured test environment minimizes the risk that test failures are due to environment setup errors rather than
actual software defects. d) Hardware and software requirements in a testing environment should always match those
in the production environment. * Answer: False * Explanation: While ideally, the test environment should closely
mirror production (especially for performance, load, and final acceptance testing), it's not always required or
feasible. Sometimes scaled-down environments are used for cost reasons, or specific configurations are needed for
certain types of testing (e.g., testing minimum requirements). The key is that the environment must be suitable for
the goals of the specific tests being run. e) Testing environments should be isolated from development environments
to avoid interference. * Answer: True * Explanation: Isolation prevents unstable code or configuration changes in
the development environment from affecting test results and ensures tests are run on a controlled, known baseline.

Q5. By using a table, differentiate Software testing tools and Hardware testing tools in software development
testing.

Feature Software Testing Tools Hardware Testing Tools


To test software applications, APIs, To test physical devices, components, interfaces, signal
Purpose
performance, security, and user interfaces. integrity, and interaction with embedded software.
Application logic, functionality, code quality,
Physical characteristics, electrical signals,
data handling, usability, security
Focus communication protocols (I2C, SPI, USB, Ethernet),
vulnerabilities, performance metrics (response
timing, environmental tolerance, physical interfaces.
time, throughput).
Oscilloscopes, Logic Analyzers, Signal Generators,
Selenium, JUnit, TestNG, Postman, JMeter,
Examples Multimeters, JTAG Debuggers, Environmental
LoadRunner, SonarQube, Appium, Cucumber.
Chambers, Protocol Analyzers.
Area Non-physical aspects of the system (code, UI, Physical aspects of the system or devices interacting
Tested database interactions, network requests). with the software.
Functional testing, regression testing, Interface testing, signal validation, compliance testing,
Typical
performance testing, security testing, API stress testing (physical/environmental), embedded
Use
testing, UI testing. software interaction testing.
Export to Sheets

Practical Assessment

Here's an outline of how to approach the tasks for the healthcare technology company's hybrid system:

1. Prepare the Test Plan:

 Introduction & Scope: Define the patient management application, its hybrid nature (integrating specific
medical devices), and what aspects (features, hardware interfaces, software modules) are in and out of
scope for this testing phase.
 Test Objectives: State clear goals, e.g., verify accurate data transfer from medical devices, ensure patient
data integrity, validate application functionality meets requirements, confirm compliance with healthcare
regulations (like HIPAA), assess system performance and reliability, ensure usability for clinical staff.
 Testing Strategy/Approach:
o Levels: Define unit, integration, system, and acceptance testing levels.
o Types: Specify types of testing needed: Functional, Integration (crucial for HW/SW interaction),
Performance, Security (especially for patient data), Usability, Compatibility (with specified
devices/OS), Regression, Compliance testing.
 Test Environment: Detail hardware (specific medical devices or simulators, servers, workstations) and
software (OS, DB, application builds, drivers) requirements (covered further in point 2).
 Test Techniques: Specify techniques (e.g., black-box, white-box, exploratory testing, equivalence
partitioning, boundary value analysis).
 Tools: List intended software tools (e.g., test management tool, automation framework like
Selenium/Appium, API tester like Postman, performance tool like JMeter) and hardware tools (e.g., device
simulators, protocol analyzers, potentially oscilloscopes if debugging interfaces).
 Test Deliverables: Define what documents/outputs will be produced (Test Plan itself, Test Cases, Test
Scripts, Test Data, Execution Logs, Defect Reports, Test Summary Report).
 Resources: Assign roles and responsibilities (Test Lead, Testers, Developers for support).
 Schedule: Outline timelines for planning, environment setup, execution cycles, and reporting.
 Entry/Exit Criteria: Define conditions that must be met to start and end testing phases (e.g., build stability
for entry, critical defect count threshold for exit).
 Risks & Mitigation: Identify potential risks (e.g., device availability, environment instability) and plan
mitigation strategies.

2. Setup of the Testing Environment:

 Hardware Setup:
o Procure or arrange access to the specified medical devices (or validated simulators if devices are
unavailable/costly).
o Set up necessary servers (application server, database server) with required specifications.
o Prepare client workstations matching target user configurations.
o Configure network infrastructure (connectivity between devices, servers, workstations; potentially
isolated test network).
 Software Setup:
o Install and configure required operating systems, database management systems.
o Deploy the specific build/version of the patient management application to be tested.
o Install necessary drivers for medical devices.
o Install all planned software testing tools (test management, automation, performance, etc.).
 Hardware Tool Setup: Connect and configure any required hardware testing tools (e.g., protocol
analyzers tapped into device communication lines).
 Test Data Preparation: Generate or acquire realistic (but anonymized, respecting privacy regulations like
HIPAA) patient data and potentially simulated medical device data streams. Load this data into the test
database/environment.
 Configuration & Verification: Configure application settings, user accounts, and permissions for testing.
Verify connectivity and basic operation of all components (hardware and software) before starting formal
execution. Ensure the environment is stable and baselined.

3. Execute Testing:

 Test Case Execution: Run the documented test cases (manual and automated) according to the plan and
schedule.
 Functional Testing: Verify the software features of the patient management application work as expected
based on requirements.
 Hardware Interaction Testing: Test the integration points – data transfer from devices, commands sent to
devices, error handling for device communication failures.
 Integration Testing: Test the interaction between different software modules and between the software
and hardware components.
 Non-Functional Testing: Execute performance, load, stress, and security tests as defined in the plan. Test
usability with representative end-users if possible.
 Defect Logging: Log any discrepancies, errors, or failures discovered during testing into a defect tracking
system with detailed steps to reproduce, expected vs. actual results, severity, and priority.
 Regression Testing: After developers provide fixes, re-test the failed test cases and execute a broader
regression suite to ensure fixes didn't introduce new problems.
 Reporting: Track test execution progress, defect metrics, and provide regular status reports (e.g.,
daily/weekly summaries, final test summary report). Communicate critical issues promptly.

Theoretical Assessment

Q1. Circle the letter corresponding with the correct answer


1. Which methodology is used to performed Maintenance testing? a) Breadth test and depth test b)
Confirmation testing c) Retesting d) Sanity testing
o Correct Answer: a) Breadth test and depth test (Maintenance testing often involves ensuring
that changes haven't broken existing functionality (depth test) and that the changes themselves
work correctly (breadth test). While retesting and sanity testing can be part of maintenance testing,
breadth and depth describe the methodology or scope.)
2. Which of the following is not part of the Test document? a) Test Case b) Requirements Traceability Matrix
[RTM] c) Test strategy d) Project Initiation Note [PIN]
o Correct Answer: d) Project Initiation Note [PIN] (A Project Initiation Note or Document is
typically part of project management documentation, defining the project scope, objectives, and
initial planning. Test cases, RTM, and Test Strategy are standard test documentation.)
3. Which term is used to define testing? a) Evaluating deliverable to find errors b) Finding broken code c) A
stage of all projects d) None of the above
o Correct Answer: a) Evaluating deliverable to find errors (While testing does involve finding
errors, it's a broader process of evaluating a software deliverable against requirements to ensure
quality and identify defects. Finding broken code is a result, not the definition. Not all "projects"
in a general sense involve software testing.)
4. Which of the following testing is related to the boundary value analysis? a) White box and black box
testing b) White-box testing c) Black box testing d) None of the above
o Correct Answer: c) Black box testing (Boundary Value Analysis is a technique used in black-
box testing, which focuses on testing the functionality of an application without knowing its
internal structure or code. It tests input values at the boundaries of valid and invalid partitions.)
5. What are the different levels of Testing? a) Integration testing b) Unit testing c) System testing d) All of the
above
o Correct Answer: d) All of the above (Unit testing, Integration testing, and System testing are all
standard levels of software testing. User Acceptance Testing (UAT) is often considered another
level as well).

Q2. Match the recommendation elements in column A to their corresponding descriptions in column B.

Here are the correct pairings based on the provided matches:

1. Executive Summary - B. Provides a brief overview of the report and the key points of the recommendation.
2. Problem Statement - D. Summarizes the issue or challenge that the recommendation addresses.
3. Proposed Solutions - E. Includes the main suggestions or recommendations made in the report to solve the
problem.
4. Action Plan - A. Outlines the steps and specific actions proposed to achieve desired outcomes.
5. Supporting Evidence - F. Offers data, research, or examples that back up the recommendations made in the
report.
6. Conclusion - G. Wraps up the report by reinforcing the key points and the importance of acting on the
recommendations.
7. Recommendations - C. Explains the reasons and supporting arguments for the recommended course of
action. (Note: There seems to be a slight mismatch in the original prompt's pairing for 'Recommendations'
and 'Proposed Solutions'. Standard practice often has 'Proposed Solutions' describe the options, while
'Recommendations' specifically state the chosen solution and the rationale. However, following your
provided matches: 7. Recommendations matches C. Explains the reasons and supporting arguments... and
3. Proposed Solutions matches E. Includes the main suggestions... I will adhere to your provided pairings).

Q3. What is the primary purpose of a User Acceptance Testing (UAT) report?

The primary purpose of a User Acceptance Testing (UAT) report is to provide stakeholders, particularly the end-
users or clients, with a clear and comprehensive summary of the UAT phase. It documents the results of the testing
performed by the users, highlighting whether the system meets their business requirements and is acceptable for
deployment. It captures test case execution status (passed, failed, blocked), details of any defects found, user
feedback, and ultimately provides a recommendation on whether the system is ready for production use from a user
perspective.

Q4. Who are the typical participants involved in UAT, and what roles do they play?

Typical participants in UAT and their roles include:

 End Users/Client Representatives: These are the primary participants. They use the system in real-world
scenarios to validate if it meets their business needs and processes. They execute test cases, provide
feedback, and identify defects from a user's perspective.
 Business Analysts: They help clarify business requirements, assist users in creating realistic test scenarios,
and ensure that the testing covers all necessary business processes. They often bridge the gap between users
and the project team.
 Project Manager: Oversees the UAT process, ensures resources are available, monitors progress, and
facilitates communication between different teams. They use the UAT report to make decisions about
deployment.
 QA Team: While not the primary testers in UAT, the QA team typically supports the UAT process. They
may help prepare the test environment, assist users with test execution, log defects reported by users, and
provide technical support.
 Development Team: Developers are involved in fixing the defects reported during UAT. They may also
provide technical assistance or clarifications if needed.
 Subject Matter Experts (SMEs): Provide in-depth knowledge about specific business processes or system
functionalities to help users and clarify requirements during testing.

Q5. How are test cases designed for UAT, and what factors are considered while creating them?

Test cases for UAT are designed from the user's perspective and are based heavily on business requirements and
real-world user scenarios.

Factors considered while creating UAT test cases include:

 Business Requirements: Test cases are directly derived from the documented business requirements to
ensure the system meets the intended business purpose.
 User Workflows: Test cases simulate the actual steps and processes that end-users will perform when
using the system in their daily work.
 Real-World Scenarios: Focus is placed on testing typical and critical scenarios that users will encounter,
including edge cases and exceptions relevant to business operations.
 Usability: Test cases often implicitly or explicitly evaluate the ease of use and user experience.
 Data Integrity: Testing ensures that data entered and processed by the system is accurate and consistent
from a business standpoint.
 Security (from a user perspective): Testing might include verifying access controls and data privacy
based on user roles.
 Integration with other systems: If the system interacts with other applications used by the business, UAT
test cases will cover these integration points.
 Input from End Users: Test cases are often reviewed and refined based on feedback and input from the
actual users who will perform the testing.

Q6. What is the difference between "Passed" and "Failed" test cases in the UAT report?

 Passed Test Case: A "Passed" test case means that when the steps outlined in the test case were executed,
the actual results observed in the system matched the expected results, and the system behaved as required
by the business specification for that particular scenario.
 Failed Test Case: A "Failed" test case means that when the steps in the test case were executed, the actual
results observed in the system did not match the expected results. This indicates a defect, discrepancy, or an
issue where the system did not meet the business requirement or user expectation.

Q7. Why is it important to include both functional and business requirements in UAT?

It is crucial to include both functional and business requirements in UAT because:

 Functional Requirements: Ensure that the system performs the specific technical functions it was
designed to do (e.g., a button saves data, a calculation is performed correctly). UAT verifies that these
functions work correctly from a user's operational standpoint.
 Business Requirements: Ensure that the system solves the actual business problem, supports the necessary
business processes, and provides value to the organization. UAT validates that the functional features align
with the overall business goals and workflows.

Testing only functional requirements might mean the system works technically but doesn't actually help users
complete their tasks or meet business objectives. Conversely, focusing only on broad business requirements might
overlook critical functional defects that prevent the system from being used effectively. UAT bridges this gap by
ensuring the system is both functionally sound and business-relevant.

Q8. What are some common issues identified during UAT, and how are they typically resolved?

Common issues identified during UAT include:

 Defects/Bugs: Functional issues where the system doesn't perform as expected according to requirements.
o Resolution: These are logged as defects in a tracking system, prioritized based on severity and
business impact, and assigned to the development team for fixing.
 Usability Issues: The system is difficult to navigate, understand, or use efficiently.
o Resolution: These are reported as feedback or enhancement requests. Depending on severity and
project constraints, they might be addressed immediately or deferred to a future release.
 Missing Functionality: Features required by the business are not present in the system.
o Resolution: This indicates a gap in requirements or development. It requires investigation to
determine if the functionality was scoped out or missed. Resolution might involve adding the
feature (if critical and within scope) or documenting it as a future enhancement.
 Incorrect Data or Data Handling: Issues with data entry, processing, storage, or reporting that don't align
with business rules.
o Resolution: Defects are logged and fixed by the development team. Data migration or correction
scripts might be needed.
 Performance Issues: The system is slow or unresponsive under expected user load.
o Resolution: Requires investigation by performance engineers and developers to identify
bottlenecks and optimize the system.
 Workflow Discrepancies: The system's workflow doesn't match the user's actual business process.
o Resolution: This might require system changes, process adjustments, or additional user training.

Resolution typically involves logging issues, prioritizing them, fixing defects, retesting the fixes (confirmation
testing), and potentially updating documentation or providing additional user training.

Q9. How do delays in UAT affect the overall project timeline and deployment?

Delays in UAT can significantly impact the overall project timeline and deployment:

 Pushes back the Go/No-Go decision: The decision to deploy often hinges on successful UAT completion.
Delays in UAT postpone this critical decision point.
 Delays Deployment: If UAT is not completed on schedule, the planned deployment date will likely be
pushed back.
 Compresses Subsequent Activities: Delays in UAT can compress the time available for subsequent
phases like production deployment, user training, and post-go-live support preparation.
 Increases Project Costs: Extended project timelines often lead to increased costs due to continued
resource allocation.
 Impacts Business Operations: If the new system is critical for business operations, a delayed deployment
can negatively impact efficiency, revenue, or customer service.
 Resource Conflicts: Delays can cause conflicts with resource availability for other projects or activities
planned after the original deployment date.

Q10. What actions should be taken after UAT if certain test cases fail?

If certain test cases fail during UAT, the following actions should be taken:

1. Document the Failure: The failed test case and the actual results must be meticulously documented in the
UAT report and the defect tracking system.
2. Log Defects: A formal defect (bug) should be created in the defect tracking system for each failure,
including steps to reproduce, actual vs. expected results, environment details, and severity level.
3. Prioritize Defects: The project team, often with input from business stakeholders, should prioritize the
defects based on their severity and business impact (e.g., critical, high, medium, low).
4. Communicate with the Development Team: The failed test cases and logged defects are communicated
to the development team for investigation and fixing.
5. Fix Defects: The development team works on resolving the identified defects based on their priority.
6. Retesting (Confirmation Testing): Once defects are fixed, the original failed test cases must be re-
executed to confirm that the fix works correctly and the test case now passes.
7. Regression Testing: Depending on the nature and location of the fixes, a subset of previously passed test
cases (regression tests) may need to be executed to ensure that the fixes haven't introduced new issues
elsewhere in the system.
8. Update UAT Report: The UAT report should be updated to reflect the status of the failed test cases and
the resolution of the defects.
9. Decision Point: Based on the number and severity of remaining open defects after retesting, the
stakeholders decide whether the system is acceptable for deployment or if further fixes and testing are
required.

Q11. What role does test data play in the success of UAT?

Test data plays a crucial role in the success of UAT:

 Realism: Using test data that closely resembles production data (while respecting privacy regulations)
allows users to test the system using familiar data structures, formats, and volumes, making the testing
more realistic and relevant to their daily work.
 Coverage of Scenarios: Appropriate test data is essential to execute all designed test cases and cover
various business scenarios, including typical cases, edge cases, and error conditions.
 Validation of Business Rules: Test data allows users to verify that the system correctly applies business
rules to different data inputs and outputs.
 Performance Testing: Realistic volumes and types of data are needed to assess the system's performance
under expected load.
 Validation of Reports and Outputs: Accurate test data is required to verify that reports, calculations, and
other system outputs are correct.

Insufficient, unrealistic, or poorly prepared test data can severely limit the effectiveness of UAT, preventing users
from thoroughly validating the system and potentially leading to critical issues being missed before deployment.
Q12. Why is it important to document the actual results alongside the expected results in UAT?

Documenting the actual results alongside the expected results in UAT is critical for several reasons:

 Verification of Success/Failure: It provides the evidence to clearly determine whether a test case passed
or failed by comparing what should have happened (expected result) with what did happen (actual result).
 Defect Reporting: When a test case fails, the actual result is essential information for logging a defect. It
tells developers exactly what the system did incorrectly, which is crucial for diagnosing and fixing the
issue.
 Clarity and Communication: It removes ambiguity about the outcome of a test. Anyone reviewing the
UAT report or defect can understand exactly what the user observed.
 Audit Trail: The documented actual results provide an audit trail of the testing performed and the observed
behavior of the system at a specific point in time.
 Regression Testing Reference: If a defect is fixed and retested later, the documented actual result of the
original failure serves as a reference point.
 Evidence for Go/No-Go Decision: The collection of actual results across all test cases provides the data
needed for stakeholders to make an informed decision about whether the system is ready for deployment.

Software Quality Assurance Assessment with Answers


Q1. Read the following statement and answer by True if correct or False otherwise
1. QA is solely responsible for finding defects in software. - Answer: False

2. QA should be performed only after development is complete. - Answer: False

3. A high defect rate indicates poor software quality. - Answer: True

4. QA teams are responsible for writing requirements and specifications. - Answer: False

5. QA teams should always strive for zero defects. - Answer: True

6. QA is only concerned with functional correctness. - Answer: False

7. Automated testing tools can completely replace manual testing. - Answer: False

8. QA teams should be isolated from development teams to avoid conflicts of interest. - Answer: False

9. Quality Assurance (QA) is primarily focused on preventing defects in a product or service. - Answer: True

10. The main stages of the Quality Assurance process include planning, assurance, and control. - Answer: True

11. Quality Control (QC) is a proactive process, while Quality Assurance (QA) is reactive. - Answer: False

12. ISO 9001 is a widely recognized standard for Quality Management Systems. - Answer: True

13. One of the main benefits of Quality Assurance is improved customer satisfaction. - Answer: True

14. Statistical process control (SPC) is a tool used in Quality Control, not in Quality Assurance. - Answer: True

15. Quality Assurance involves the use of methods like audits and process evaluations. - Answer: True

16. Lean methodology is an example of a Quality Assurance standard. - Answer: False

Q2. Circle the letter corresponding with the correct answer


1. Which of the following is NOT an example of industry-specific QA?
Answer: d. Retail QA
2. Which of the following is a benefit of manual testing?
Answer: c. Ability to detect subtle defects

3. The main objective of quality assurance is:


Answer: d. Customer satisfaction

4. The primary goal of analyzing an inception report is to:


Answer: d. All of the above

5. What is the purpose of documenting assumptions and constraints in an inception report analysis?
Answer: d. All of the above

6. The findings from an inception report analysis are used to:


Answer: d. All of the above

Q3. What is Quality Assurance (QA) in software development?


Answer: QA in software development is a systematic process that ensures the software meets specified
requirements and standards. It focuses on improving the development and test processes to prevent defects.

Q4. What is the main difference between Quality Assurance (QA) and Quality Control (QC)?
Answer: QA is process-oriented and focuses on preventing defects, while QC is product-oriented and focuses on
identifying defects in finished products.

Q5. Fill in the blanks


1. ______ is part of quality management focused on providing confidence that quality requirements will be
fulfilled.
Answer: c. Quality assurance

2. The first step in analyzing an inception report is to perform a ______.


Answer: a. document review

Q6. What is the difference between functional and non-functional requirements?


Answer: Functional requirements define what the system should do (e.g., features, operations), while non-
functional requirements define how the system performs (e.g., performance, security, usability).

Practical Assessment
XYZ company is embarking on a new software development project to launch an advanced CRM system. The QA
team is responsible for ensuring the product meets both functional and non-functional requirements while
adhering to industry standards. The QA team is tasked with:
1. Implementing quality assurance processes
2. Analysing the Terms of Reference (ToR)
3. Reviewing the requirement specifications
4. Assessing the project’s inception report

System Administration
Networking and Window Server

Part 1: Multiple Choice Questions with Answers

1. Which network topology connects all devices to a single central hub? ✅ a) Star ➝ In a star topology,
all devices are connected to a central hub or switch, making troubleshooting easier.
2. What type of cable is commonly used for high-speed internet connections and has high resistance to
interference? ✅ c) Fiber optic ➝ Fiber optic cables transmit data at high speeds over long distances
and are resistant to electromagnetic interference.
3. Which network device amplifies signals to extend the range of a network? ✅ c) Repeater ➝ A
repeater strengthens signals, allowing data to travel longer distances without degradation.
4. What is the primary benefit of using fiber optic cables over copper cables? ✅ b) Higher speed and
bandwidth ➝ Fiber optics allow faster data transmission with less signal loss.
5. Which tool is used to remove the insulation from network cables? ✅ b) Stripping tool ➝ A stripping
tool is designed to remove the outer layer of network cables without damaging the wires inside.
6. In a network, what device is used to connect different network segments and route data between
them? ✅ b) Router ➝ Routers manage network traffic and connect different networks, such as LANs
to the internet.
7. What type of network cabling is suitable for outdoor installations? ✅ b) Fiber optic ➝ Fiber optic
cables are suitable for outdoor installation due to their weather resistance.
8. Which network topology requires that each device is connected to exactly two other devices? ✅ c)
Ring ➝ In a ring topology, each device has two direct neighbors, forming a circular data path.
9. Which of the following is a common connector type for twisted pair cables? ✅ a) RJ45 ➝ RJ45
connectors are used in Ethernet networks for connecting twisted pair cables.
10. What is the purpose of a network patch panel? ✅ b) To connect and organize cables ➝ Patch panels
centralize cable management, making network maintenance easier.
11. Which network topology involves all devices being connected in a straight line? ✅ c) Bus ➝ In a bus
topology, all devices share a single communication line.
12. Which of the following is a disadvantage of a bus topology? ✅ c) If one cable fails, the entire network
goes down ➝ Single-point failure can affect all connected devices in bus topology.
13. Which tool is used to test the continuity of network cables? ✅ b) Testing tool ➝ Cable testers check if
a cable is properly connected and not damaged.
14. What material is commonly used for trunking in network cable installations? ✅ b) Plastic ➝ Plastic
trunking is commonly used to organize and protect cables.
15. Which type of network cable is best suited for high-speed data transmission over long distances? ✅
c) Fiber optic ➝ Fiber optic is ideal for high-speed, long-distance data transmission.

Part 2: Matching Network Components

Network Component Function


1. Router ✅ b) Routes data between different networks
2. Patch Panel ✅ a) Connects and organizes cables
3. Switch ✅ d) Connects devices within the same network segment
4. Repeater ✅ c) Amplifies network signals
5. Crimping Tool ✅ e) Joins network cables to connectors
6. Fiber Optic Cable ✅ f) Used for high-speed data transmission
7. RJ45 Connector ✅ g) Connects twisted pair cables
Network Component Function
8. Network Diagram ✅ h) Visual representation of network setup
9. Cable Tie ✅ i) Bundles and organizes cables
10. Drilling Tool ✅ j) Creates holes for cable routing

Part 3: True or False Statements

✅ 1. Network cables with twisted pair configurations are less susceptible to interference. → True ✅ 2. Fiber
optic cables are commonly used for short-distance connections due to their high cost. → False (Fiber optic
cables are used for long-distance connections.) ✅ 3. A network hub operates by sending data to all devices
connected to it. → True ✅ 4. A switch can improve network performance by reducing data collisions. →
True ✅ 5. Coaxial cables are the most suitable for high-speed internet connections. → False (Fiber optic cables
are better for high-speed internet.) ✅ 6. The RJ45 connector is used for fiber optic cables. → False (RJ45 is
used for twisted pair cables.) ✅ 7. Cable ties are used to secure and organize cables. → True ✅ 8. Patching
refers to connecting different networks through a patch panel. → False (Patching refers to organizing cable
connections.) ✅ 9. A UPS provides backup power to network equipment during outages. → True ✅ 10.
Tagging is the process of assigning labels to network devices and cables. → True

✅ 11. A router is used to connect different networks and route data between them. → True ✅ 12. Crimping
tools are used for testing the continuity of network cables. → False (Cable testers are used for continuity
testing.) ✅ 13. The main advantage of using coaxial cables is their flexibility and ease of installation. → False
(Fiber optic and twisted pair cables are more flexible.) ✅ 14. Open-wire network installations are typically used
for outdoor aerial connections. → True ✅ 15. Fiber optic cables are resistant to electromagnetic interference.
→ True

Practical Assessment: Network Installation for XYZ Hospital

Key Steps in Network Installation

✅ 1. Identify & Select Tools, Materials, and Equipment

 Crimping tool → For terminating RJ4️5️ connectors


 Testing tool → For verifying cable connections
 Fiber optic cables → For high-speed transmission
 Routers & switches → To manage network traffic
 Cable ties & patch panels → For cable organization

✅ 2. Install Trunks & Terminate Cables

 Install trunking materials along walls to organize cables


 Strip cables and terminate RJ45 connectors using crimping tools
 Use fiber optic cables for backbone connections

✅ 3. Connect Devices & Test the Network

 Connect hospital computers to network switches


 Configure routers for secure internet access
 Test the network using cable testers
🚀 Outcome: Efficient, high-speed hospital networking!

Theoretical Assessment: Network Implementation & Testing


Part 1: Multiple Choice Questions with Answers

1. What is the primary purpose of an IP address? ✅ b) To identify devices on a network ➝ An IP


address uniquely identifies each device on a network for communication.
2. Which of the following is a characteristic of a static IP address? ✅ c) It remains constant unless
manually changed ➝ Static IP addresses do not change unless configured manually.
3. What is the primary difference between IPv4 and IPv6? ✅ c) IPv4 addresses are 32-bit, while IPv6
addresses are 128-bit ➝ IPv6 provides a larger address space than IPv4.
4. Which class of IP addresses is typically used for multicast groups? ✅ d) Class D ➝ Class D is
reserved for multicast communications.
5. In subnetting, what does the subnet mask 255.255.255.0 indicate? ✅ c) The first 24 bits are the
network portion ➝ A /24 subnet mask allows 256 IPs per subnet (254 usable).
6. Which of the following is a benefit of subnetting? ✅ b) Reduces network traffic by limiting broadcast
domains ➝ Subnetting divides a network into smaller segments to improve efficiency.
7. Which binary number corresponds to the decimal number 192? ✅ a) 11000000 ➝ 192 in binary is
11000000.
8. Which type of subnetting is used to allocate IP addresses to subnets of varying sizes? ✅ b) Variable-
Length Subnet Mask (VLSM) ➝ VLSM allows custom-sized subnets for efficient IP usage.
9. Which logical operator is used to determine the network address in subnetting? ✅ b) AND ➝ The
AND operator is used when calculating network addresses.
10. What is the role of a DHCP server in assigning IP addresses? ✅ b) To automatically allocate IP
addresses within a network ➝ DHCP automates IP address allocation, preventing conflicts.
11. Which command is used to set a hostname on a Cisco switch? ✅ b) Hostname ➝ The hostname
command assigns a name to a network device.
12. What is the purpose of a banner message on a network device? ✅ b) To display a message when a
user logs in ➝ Banner messages notify users of rules or warnings upon login.
13. Which of the following is NOT a device configuration mode in Cisco networking? ✅ d) Host
configuration mode ➝ Host configuration does not exist as a Cisco mode.
14. What is the purpose of saving a network device’s configuration? ✅ b) To ensure the configuration is
retained after a reboot ➝ Saving ensures settings persist after restart.
15. Which type of testing verifies that all network components work together as intended? ✅ c)
Integration Testing ➝ Integration testing ensures smooth operation among all network devices.

Part 2: Matching Network Concepts


Term Correct Description

A. Class A IP Address ✅ 2. Used to uniquely identify a device on a network

B. VLSM ✅ 5. Used to create subnets of different sizes

C. Binary System ✅ 10. The base-2 number system used in networking

D. Dynamic IP Address ✅ 1. Provides automatic IP addresses within a network

E. Static IP Address ✅ 4. Assigns a fixed IP address manually


Term Correct Description

F. IPv4 ✅ 6. Uses 32-bit addresses for IP networking

G. IPv6 ✅ 7. Uses 128-bit addresses for IP networking

H. Subnet Mask ✅ 8. Used to calculate network and broadcast addresses

I. Integration Testing ✅ 9. Network testing involving the entire system

J. Logical AND Operator ✅ 3. The subnet mask divides a network into subnets

Part 3: True or False Statements

✅ 1. Class B IP addresses have a default subnet mask of 255.255.0.0. → True ✅ 2. Static IP addresses are
assigned automatically by a DHCP server. → False (Static IPs are manually assigned.) ✅ 3. IPv6 addresses are
written in hexadecimal format. → True ✅ 4. A subnet mask of 255.255.255.240 allows for 14 usable host
addresses. → True ✅ 5. Subnetting reduces the number of available IP addresses in a network. → False
(Subnetting divides an IP range for better management.) ✅ 6. The binary equivalent of the decimal number 128
is 10000000. → True ✅ 7. CIDR allows for more flexible IP address allocation than traditional subnetting. →
True ✅ 8. A logical OR operation is used to calculate network addresses. → False (AND is used for network
address calculations.) ✅ 9. Automatic IP address assignment can occur without a DHCP server. → False
(DHCP automates IP allocation.) ✅ 10. The hostname of a network device must be unique within the
network. → True

Practical Assessment: Network Implementation for Office in Musanze District


1. Network Design & Subnetting

✅ Given IP Range: 192.168.10.0/24 ✅ Office has 4 departments → Each requires a separate subnet

Subnet Calculation

Each department needs at least 30 devices: Using CIDR notation, /27 provides 32 total IPs per subnet (30
usable)

 Network 1: 192.168.10.0/27 → Hosts: 192.168.10.1 - 192.168.10.30


 Network 2: 192.168.10.32/27 → Hosts: 192.168.10.33 - 192.168.10.62
 Network 3: 192.168.10.64/27 → Hosts: 192.168.10.65 - 192.168.10.94
 Network 4: 192.168.10.96/27 → Hosts: 192.168.10.97 - 192.168.10.126

2. Router & Switch Configuration

✅ Assign Hostnames

bash

Router(config)# hostname OfficeRouter


Switch(config)# hostname OfficeSwitch
✅ Configure Banner Message

bash

Router(config)# banner motd "Unauthorized access is prohibited!"


Switch(config)# banner motd "Welcome to Office Switch!"

✅ Set Up Static IP Addresses

bash

Router(config)# interface g0/0


Router(config-if)# ip address 192.168.10.1 255.255.255.224
Router(config-if)# no shutdown

✅ Configure Switch Ports

bash

Switch(config)# interface fa0/1


Switch(config-if)# switchport mode access
Switch(config-if)# no shutdown

✅ Set Up Strong Passwords

bash

Router(config)# enable secret OfficePass123


Switch(config)# enable secret SwitchPass123
3. Network Testing

✅ Physical Testing

 Ensure cables are correctly terminated


 Verify power and connectivity of devices

✅ Unit Testing

 Ping router from each computer


 Verify printer accessibility
 Check port configurations on the switch

✅ Integration Testing

 Ensure communication between different subnets


 Test file sharing & printing
 Validate DHCP functionality for new devices

🚀 Outcome: Fully operational network with optimized IP addressing, configured devices, and verified
connectivity!
Theoretical Assessment: Network Maintenance
Part 1: Multiple-Choice Questions with Answers

1. Which of the following is a common practice in hardware preventive maintenance for network
equipment? ✅ C) Cleaning dust from hardware components ➝ Dust buildup can cause overheating
and hardware failures.
2. What is the primary purpose of software preventive maintenance in a network environment? ✅ C)
To enhance software performance and security ➝ Regular updates prevent vulnerabilities and
optimize performance.
3. Which tool is most commonly used to check the integrity of network cables during preventive
maintenance? ✅ B) Cable tester ➝ A cable tester verifies if a cable is properly transmitting signals.
4. During preventive maintenance, why is it important to keep firmware up to date on network devices?
✅ D) To patch security vulnerabilities and improve device performance ➝ New firmware fixes bugs
and enhances device security.
5. What should be done before performing any hardware preventive maintenance on network
equipment? ✅ C) Back up the current configuration ➝ Backups ensure network settings are preserved
in case of failure.

Part 2: True or False Statements

1. Corrective maintenance involves making changes to a network configuration after a failure or


problem has been identified. ✅ True
2. Corrective maintenance in networking is only performed on software components, not hardware. ❌
False (It applies to both hardware and software.)
3. Replacing a faulty network switch with a new one is an example of corrective maintenance. ✅ True
4. Corrective maintenance is typically performed on a scheduled basis, even if no issues are present. ❌
False (It is reactive, not scheduled.)
5. The primary goal of corrective maintenance is to restore network functionality after a disruption. ✅
True
6. Corrective maintenance should always be documented to ensure a record of what was done and why.
✅ True
7. Updating antivirus software to protect against new threats is considered corrective maintenance. ❌
False (This is preventive maintenance.)
8. Corrective maintenance is only necessary when a complete network failure occurs. ❌ False (It applies
to any issue, not just failures.)

Part 3: Network Maintenance Reporting

1. What are the three main ways of reporting the outcome of a network maintenance activity? ✅
Incident Reports → Document specific issues and resolutions. ✅ Maintenance Logs → Record
scheduled or corrective maintenance actions. ✅ Network Performance Analysis → Use metrics to track
efficiency improvements.
2. Why is it important to include the tools, materials, and equipment used in a maintenance report? ✅
Ensures accuracy → Helps IT teams track repairs and replacements. ✅ Standardizes procedures →
Improves consistency for future maintenance. ✅ Facilitates budgeting → Assists in cost estimation for
upgrades.
Practical Assessment: Diagnosing & Resolving Network Issues at ABC Corp
Step 1: Identify & Diagnose the Issues

✅ Network Symptoms:

 Slow speeds → Possible network congestion or misconfigured QoS


 Frequent downtime → Could indicate hardware failures or unstable connections
 Intermittent connectivity → Likely cable faults or interference

✅ Diagnostic Tools:

 Ping & Traceroute → Check network latency


 Cable Tester → Ensure proper cable functionality
 Packet Sniffer (Wireshark) → Analyze network traffic patterns

Step 2: Implement Corrective Maintenance

✅ 1. Troubleshoot Connectivity Issues

 Verify physical connections (cables, power supplies).


 Check network logs for errors or abnormal activity.

✅ 2. Optimize Network Performance

 Configure Quality of Service (QoS) settings.


 Reduce network congestion by segmenting VLANs.

✅ 3. Address Hardware Failures

 Replace faulty switches or routers if necessary.


 Upgrade firmware for enhanced stability.

🚀 Outcome: Stable network with improved performance and reduced downtime!

Window Server Administration

Theoretical Assessment: Windows Server Administration

Part 1: Multiple-Choice Questions with Answers

1. What is a primary function of a server in a network? ✅ B) To provide resources, data, or services to


clients ➝ Servers manage data, applications, and security for network clients.
2. What type of hypervisor runs directly on the physical hardware without needing a host operating
system? ✅ C) Bare-Metal Hypervisor ➝ Bare-metal hypervisors offer direct access to hardware,
improving performance.
3. Which of the following is an advantage of server virtualization? ✅ C) Improved disaster recovery ➝
Virtualized environments allow for quick recovery from failures.
4. What is the key characteristic of RAID 0? ✅ B) It splits data into blocks and distributes them across
multiple disks without redundancy. ➝ RAID 0 offers performance improvements but lacks fault
tolerance.
5. Which RAID level offers protection against up to two disk failures? ✅ D) RAID 6 ➝ RAID 6 uses
double parity, allowing recovery even if two disks fail.
6. What does a Type 2 Hypervisor require to operate? ✅ B) A host operating system ➝ Type 2
hypervisors run on top of an OS, unlike bare-metal hypervisors.
7. Which RAID level combines striping and mirroring for high performance and fault tolerance? ✅ D)
RAID 10 ➝ RAID 10 combines RAID 0 (striping) and RAID 1 (mirroring) for speed & redundancy.
8. What is a disadvantage of RAID 5? ✅ C) It has slower write performance due to parity calculations.
➝ RAID 5 requires extra processing for writing parity data.
9. Which software component is essential for managing a network and enabling communication
between servers and clients? ✅ C) Network Operating System (NOS) ➝ NOS enables centralized
network management for smooth operations.
10. What is the primary function of a domain controller (DC) in a Windows Server environment? ✅ B)
To authenticate and authorize users and computers ➝ The DC manages user authentication through
Active Directory (AD).
11. Which RSAT tool is used to manage users, groups, and organizational units in Active Directory? ✅
B) Active Directory Users and Computers (ADUC) ➝ ADUC manages user accounts & groups in
Active Directory.
12. Which RSAT tool would you use to manage DNS zones and records? ✅ D) DNS Manager ➝ DNS
Manager allows DNS configuration & troubleshooting.
13. What is the purpose of the Group Policy Management Console (GPMC)? ✅ C) To manage Group
Policy Objects (GPOs) ➝ GPMC configures policies for user access & security.
14. Which tool is used to configure and manage DHCP scopes and IP address leases? ✅ B) DHCP
Manager ➝ DHCP Manager configures automatic IP assignment.
15. What role does Active Directory Domain Services (AD DS) serve in a server environment? ✅ C) It
handles user authentication and authorization. ➝ AD DS centralizes user access control in Windows
environments.
16. What is the purpose of server roles in a Windows Server environment? ✅ C) To enable the server to
perform specific functions for users or other computers ➝ Roles define services such as DNS, DHCP,
or AD.
17. Which RSAT tool would you use to manage virtual machines and virtual networks? ✅ A) Hyper-V
Manager ➝ Hyper-V Manager manages virtual machines and virtual networking.
18. What do server features in Windows Server do? ✅ B) They provide optional components that
enhance server capabilities. ➝ Features provide additional enhancements, such as backup tools or
security extensions.
19. Which RSAT tool provides an overview and management of server roles, features, status, and
performance? ✅ C) Server Manager ➝ Server Manager offers centralized administration for
Windows Server.

Part 2: Fill in the Blanks

1. A ✅ Recursive query involves the DNS server handling the entire resolution process and returning
the final result to the client.
2. In DNS operations, ✅ Caching helps improve performance by storing recently resolved query
results.
3. Root Hints ✅ are lists of IP addresses of root DNS servers used by DNS servers to start the
resolution process.
4. An ✅ Authoritative DNS server provides definitive answers for queries about domains it is
responsible for.
5. A ✅ Zone file contains DNS resource records such as A, CNAME, and MX records for a zone.
6. The DHCP client starts the process by sending a ✅ Discover message to locate available DHCP
servers.
7. The DHCP server confirms the assignment of an IP address and provides additional configuration
settings with an ✅ Acknowledgement message.
8. The DHCP process begins with the client sending a ✅ Discover message.
9. DHCP ✅ Failover involves configuring two DHCP servers to share lease information, allowing one
server to take over if the other fails.
10. To prevent unauthorized DHCP servers from providing IP addresses, network administrators use ✅
DHCP Snooping on switches.
11. A DHCP ✅ Relay agent forwards DHCP messages between clients and servers when they are on
different subnets.
12. The DHCP relay agent operates by receiving DHCP requests from clients and ✅ Forwarding them
to the appropriate DHCP server.

Practical Assessment: Windows Server Setup for Bxz Solutions Inc.

Step 1: Prepare Windows Server Environment

✅ Install Windows Server ✅ Verify network settings & assign static IP ✅ Create administrator account &
set strong password

Step 2: Install & Configure Active Directory

✅ Install AD DS Role

powershell
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools

✅ Promote Server to Domain Controller

powershell
Install-ADDSForest -DomainName "bxzsolutions.local"

✅ Create & Manage User Groups

 Define security policies


 Assign permissions

Step 3: Install & Configure Services

✅ Install & Configure DHCP Server

powershell
Install-WindowsFeature -Name DHCP -IncludeManagementTools

✅ Define DHCP Scope


powershell
Add-DhcpServerv4Scope -Name "Office Network" -StartRange 192.168.1.100 -
EndRange 192.168.1.200 -SubnetMask 255.255.255.0

✅ Install & Configure DNS Server

powershell
Install-WindowsFeature -Name DNS -IncludeManagementTools

✅ Configure NSLOOKUP for Troubleshooting

powershell
nslookup bxzsolutions.local

Final Outcome

✅ Fully configured Active Directory for network authentication ✅ DHCP, DNS, and essential services
installed for efficient management ✅ Verified system functionality using NSLOOKUP & DHCP tests

Theoretical Assessment: Active Directory Management

Question 1: Multiple-Choice Questions with Answers

1. Which of the following is a security group in Windows Server? ✅ d) All of the above ➝ Security
groups in Active Directory include Global, Universal, and Domain Local Groups, each serving different
purposes.
2. What is the purpose of an Organizational Unit (OU) in Active Directory? ✅ c) To organize objects
hierarchically and logically ➝ OUs help organize and manage users, computers, and groups in a
structured way.
3. Which of the following is not a common user account permission in Active Directory? ✅ d)
Administrator ➝ Permissions like Full Control, Modify, and Read/Write are common; Administrator
is a role, not a permission.
4. What is the default user account type created when a new user is added to Active Directory? ✅ d)
Domain User ➝ New users by default are Domain Users, who have basic access within the domain.

Question 2: True or False Statements

1. The Domain Admins group has full control over all objects in an Active Directory domain. ✅ True
2. You can create a new user account by copying an existing one. ✅ True

Question 3: Fill in the Blanks

1. A(n) ✅ Organizational Unit (OU) is a collection of user accounts and other objects in Active
Directory.
2. The ✅ Member Of tab in the user account properties dialog allows you to manage group
memberships.
3. To change a user's password in Active Directory, you need to have ✅ Administrator privileges.

Practical Assessment: Active Directory User & Group Management


Step 1: Create New User Accounts

✅ Create accounts using Active Directory Users and Computers (ADUC)

powershell
New-ADUser -Name "Umutoni Claudine" -GivenName "Umutoni" -Surname "Claudine"
-Department "Sales" -UserPrincipalName "[email protected]"
New-ADUser -Name "Kamali Emmanuel" -GivenName "Kamali" -Surname "Emmanuel" -
Department "IT" -UserPrincipalName "[email protected]"
New-ADUser -Name "Kanyana Viviane" -GivenName "Kanyana" -Surname "Viviane" -
Department "HR" -UserPrincipalName "[email protected]"

✅ Set strong passwords for all accounts

powershell
Set-ADAccountPassword -Identity "[email protected]" -
NewPassword (ConvertTo-SecureString "StrongP@ss123" -AsPlainText -Force)
Set-ADAccountPassword -Identity "[email protected]" -
NewPassword (ConvertTo-SecureString "SecureP@ss456" -AsPlainText -Force)
Set-ADAccountPassword -Identity "[email protected]" -
NewPassword (ConvertTo-SecureString "HRP@ss789" -AsPlainText -Force)

Step 2: Create & Assign User Groups

✅ Create Groups for Role-Based Access

powershell
New-ADGroup -Name "Sales Team" -GroupScope Global -GroupCategory Security
New-ADGroup -Name "IT Support" -GroupScope Global -GroupCategory Security

✅ Assign Users to Groups

powershell
Add-ADGroupMember -Identity "Sales Team" -Members "UClaudine"
Add-ADGroupMember -Identity "IT Support" -Members "KEmmanuel"

✅ Set Group Permissions

powershell
Grant-ADPermission -Identity "Sales Team" -Permission Read
Grant-ADPermission -Identity "IT Support" -Permission FullControl

Step 3: Organize Users into OUs

✅ Create Organizational Units

powershell
New-ADOrganizationalUnit -Name "Sales" -Path
"OU=SpecialSolutions,DC=specialsolutions,DC=local"
New-ADOrganizationalUnit -Name "IT" -Path
"OU=SpecialSolutions,DC=specialsolutions,DC=local"
New-ADOrganizationalUnit -Name "Human Resources" -Path
"OU=SpecialSolutions,DC=specialsolutions,DC=local"

✅ Move Users to Their Respective OUs

powershell
Move-ADObject -Identity "CN=Umutoni Claudine,DC=specialsolutions,DC=local" -
TargetPath "OU=Sales,DC=specialsolutions,DC=local"
Move-ADObject -Identity "CN=Kamali Emmanuel,DC=specialsolutions,DC=local" -
TargetPath "OU=IT,DC=specialsolutions,DC=local"
Move-ADObject -Identity "CN=Kanyana Viviane,DC=specialsolutions,DC=local" -
TargetPath "OU=Human Resources,DC=specialsolutions,DC=local"

✅ Apply Organizational Policies

 Restrict access to HR data for non-HR members


 Allow IT full administrative control over networks
 Ensure sales department users can only access sales-related files

Step 4: Delegate Permissions to a Help Desk Technician

✅ Grant Help Desk Technician Password Reset Privileges

powershell
Set-ADACL -Identity "HelpDeskTechnician" -Permissions "Reset Password"

✅ Delegate User Management for Sales & IT Departments

powershell
DelegateControl -OU "Sales" -Identity "HelpDeskTechnician" -Permissions
"Create/Delete User Accounts"
DelegateControl -OU "IT" -Identity "HelpDeskTechnician" -Permissions
"Create/Delete User Accounts"

Step 5: Implement Security Policies

✅ Enable Account Lockout Policies

powershell
Set-ADDefaultDomainPasswordPolicy -ComplexityEnabled $true -LockoutThreshold
5 -MaxPasswordAge 90

✅ Enforce Password Complexity & Expiry

powershell
Set-ADAccountControl -Identity "SpecialSolutionsUsers" -
PasswordComplexityRequired $true -PasswordNeverExpires $false

✅ Audit User Activities for Compliance

powershell
Enable-ADUserAudit -Identity "SpecialSolutionsUsers"

Final Documentation & Monitoring

✅ Document all user accounts, permissions, and security policies ✅ Regularly audit user activities and
compliance reports ✅ Provide user training on security practices and password management

🚀 Outcome: Fully managed Active Directory with structured user access and security policies in place!

Theoretical Assessment: Internet Information Services (IIS)

Question 1: Multiple-Choice Questions with Answers

1. What is Handler Mapping in IIS? ✅ b) Assigning request handlers to specific types of requests ➝
Handler Mapping assigns request handlers for different file types (such as .aspx, .php, .html).
2. Which of the following is NOT a type of web server? ✅ c) SQLite ➝ SQLite is a database
management system, not a web server.
3. What protocol is used for secure communication between a client and a web server? ✅ c) HTTPS ➝
HTTPS encrypts communication between client and server using SSL/TLS certificates.
4. Which of the following is a benefit of using IIS? ✅ c) Tight integration with Windows and .NET ➝
IIS is optimized for Windows Server and integrates well with .NET applications.
5. Which environment variable should be set to specify the configuration file for PHP in IIS? ✅ b)
PHP_INI_DIR ➝ This variable specifies the location of the PHP configuration file (php.ini).

Question 2: Fill in the Blanks

1. The default port number for HTTP is ✅ a) 80


2. The PHP handler in IIS is configured using ✅ c) FastCGI ➝ FastCGI improves PHP performance on
IIS.
3. Node.js applications in IIS are managed using the module ✅ b) IISNode ➝ IISNode allows Node.js
applications to run on IIS.
4. Free hosting platforms typically offer ✅ b) Limited resources compared to paid hosting platforms.
5. The process of configuring an SSL certificate for secure communication in IIS involves setting up ✅
c) HTTPS binding

Question 3: True or False Statements

1. IIS can be installed on Linux-based systems. ❌ False ➝ IIS is Windows-only; Linux uses Apache or
Nginx.
2. FTP is used to transfer files securely between a client and a server. ❌ False ➝ FTP is not secure;
FTPS or SFTP should be used instead.
3. WinCache is a caching extension for PHP that can be used in IIS to improve performance. ✅ True
4. Site binding in IIS is used to define how the server listens for incoming connections, specifying the
protocol, IP address, port, and hostname. ✅ True
5. The SSL certificate is required to enable HTTP site binding in IIS. ❌ False ➝ SSL certificates are
only required for HTTPS bindings.

Practical Assessment: Hosting a Web Application on Windows Server

Step 1: Install IIS


✅ Enable IIS Role in Windows Server

powershell
Install-WindowsFeature -Name Web-Server -IncludeManagementTools

✅ Verify IIS Installation

powershell
iisreset

Step 2: Configure Web Application Hosting

✅ Set Up a Website in IIS

powershell
New-WebSite -Name "FFF Rwanda" -Port 80 -PhysicalPath
"C:\inetpub\wwwroot\FFF_Rwanda" -HostHeader "www.fffrwanda.site"

✅ Enable HTTPS Access

powershell
New-WebBinding -Name "FFF Rwanda" -IPAddress "*" -Port 443 -Protocol "https"

✅ Install SSL Certificate

1. Generate SSL certificate request (.csr)


2. Obtain certificate from a Certificate Authority (CA)
3. Import SSL certificate to IIS
4. Bind SSL certificate to HTTPS

🚀 Outcome: FFF Ltd can now access their web application via both HTTP and HTTPS!

Practical Assessment: Hosting a Web Application on Windows Server 2012 R2


Step 1: Install IIS

✅ Enable IIS Role in Windows Server 2012 R2

1. Open Server Manager → Click Manage → Select Add Roles and Features.
2. Choose Role-based or Feature-based Installation.
3. Select the server and click Next.
4. Under Server Roles, check Web Server (IIS).
5. Install required features (like CGI for PHP, IIS Management Tools).
6. Click Install.

Step 2: Set Up Website Hosting

✅ Create a Site in IIS

1. Open IIS Manager.


2. Expand the server node, right-click Sites → Select Add Website.
3. Enter Site Name: "FFF Rwanda".
4. Set Physical Path: "C:\inetpub\wwwroot\FFF_Rwanda".
5. Choose IP Address: "All Unassigned" → Enter Host Name: "www.fffrwanda.site".
6. Click OK to create the site.

✅ Enable HTTP Binding

1. Open IIS Manager.


2. Select "FFF Rwanda".
3. Click Bindings (right-side panel).
4. Click Add → Choose HTTP.
5. Set Port: "80" → Click OK.

Step 3: Enable HTTPS and Install SSL Certificate

✅ Generate SSL Certificate

1. Open IIS Manager → Select FFF Rwanda.


2. Click Bindings → Add HTTPS binding.
3. Choose an SSL Certificate:
o Use Self-Signed Certificate for testing.
o Install a CA-approved certificate for production.

✅ Redirect HTTP to HTTPS

1. Open IIS Manager → Select "FFF Rwanda".


2. Click URL Rewrite → Add Rules.
3. Select Redirect HTTP to HTTPS → Save settings.

Step 4: Verify Website Accessibility

✅ Testing HTTP & HTTPS

1. Open Command Prompt.


2. Check DNS resolution:

powershell

nslookup www.fffrwanda.site

3. Check network connectivity:

powershell

ping www.fffrwanda.site

4. Open browser and test:

text
http://www.fffrwanda.site
https://www.fffrwanda.site

5. Ensure SSL certificate validation.

🚀 Outcome: FFF Ltd's web application is now securely accessible via both HTTP and HTTPS!

You might also like