Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because...

66
Computing Science (Advanced Higher) Understanding Standards Events 2019 Workshop Tasks (16)

Transcript of Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because...

Page 1: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

Computing Science (Advanced Higher)

Understanding Standards Events 2019 — Workshop Tasks (1–6)

Page 2: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

1

Contents

Workshop 1 — Analysis of the problem 2

Workshop 2 — Design of the solution 20

Workshop 3 — Implementation 31

Workshop 4 — Testing the solution 51

Workshop 5 — Evaluation of the solution 53

Workshop 6 — Ensuring projects meet the Advanced Higher criteria 57

Appendix 1 61

Appendix 2 62

Appendix 3 63

Page 3: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

2

Workshop 1

Analysis of the problem

Task

Use the marking instructions on page 5 of the Advanced Higher project assessment task

document available at https://www.sqa.org.uk/sqa/files_ccc/AHCATComputingScience.pdf to

mark the analysis evidence for candidates 1 and 2.

You can record your marks on the grid that follows each candidate’s evidence in this booklet.

The total mark that was awarded for analysis is provided in the grid.

Page 4: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

3

Candidate 1 evidence

Analysis of the Problem

Description of Problem

I intend to develop a quiz based on well-known historical events. The quiz will have

three levels of difficulty so that the user can select a level on either their historical

knowledge or how much of a challenge they want to set themselves. I intend to

include the following features: login facilities, help screens, each level of difficulty will

have a quiz selected at random, each quiz will have multiple choice questions and a

leader board that can be sorted.

The end-users of my quiz will specifically be S1-S6 students who study history at school

but also anybody who is interested in history and wants to test their knowledge.

My project meets the advanced higher computing requirements because it will have a

user interface suitable for S1-S6 students which will be easy to use and will validate all

inputs. My project will interface with stored data within a database for the questions

(using SQL) and also with a text file to store the login facilities (these will be processed

using an array of records). My project will also use a sort algorithm to arrange the details

leader board details.

Scope

The scope of my project will include:

1. A completed design with pseudocode, data dictionary, query design and

wireframes showing the intended interface for the quiz

2. A working quiz and a database with multiple choice quiz questions

3. Completed test plan with descriptions of a test persona, test cases and

expected outputs

4. The results of final testing

5. An evaluation report

Constraints

There are a number of technical, economic and time constraints that will apply to this

development.

Page 5: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

4

1. I will use LiveCode version 9 to create the quiz because I have several years’

experience using this language

2. The final solution will run on the Windows systems with ODBC to access my quiz

database.

3. Microsoft Access will be used to store my quiz questions

4. There will be no costs involved in the development of my project because I am

using software that is fully licensed and readily available in school

5. I will ensure that my project is completed by the deadline of 29th March as it will

need to be delivered to SQA for marking. The submission deadline is 4th April

2019.

Boundaries

My working solution will contain:

1. A system to allow users to sign up with a new username and password

combination

The user cannot have a password of less than 4 characters

2. A system to allow users to log in with their unique username and password

3. All user input must be validated

4. Three quizzes of different levels of Easy, Medium and Hard will be available

5. Each quiz will contain 10 questions that will be presented to the user in a random

order

Users will not be able to choose how many questions per run through of

the quiz they do

Users will only be able to choose their difficulty level, they will not be able

to choose which questions they are asked

6. The score achieved by each user will be stored in the leader board file

corresponding to the correct difficulty level

7. A leader board that will display the top 10 scores and usernames for each

difficulty level

The leader board for each level will be sorted in descending order of

score

Page 6: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

5

UML Use Case Diagram

Requirements Specification

For my system to be able to fulfil its requirements, it must meet several criteria:

Login System Requirements

Users of my system will be able to create a unique username-password combination to

access the quiz. The login functionality will include:

1. The Login page is the first screen that users will see, and will allow the user to

enter

a) A valid username and

b) A valid password

2. The user will then press the “Login” button, which will check that the username

and password they have entered is valid by:

a) Checking that neither field is blank

b) Checking that the password entered contains more than 4 characters

c) Importing stored usernames and passwords from the login file

d) Checking that the username and password combination exists in the login file

3. If the user passes this validation:

Page 7: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

6

a) The username will be stored in a variable to be accessed throughout the

program

b) The user will be directed to the Home page to select one of three levels of

difficulty options for the quiz

Login screen inputs o Users will login by entering their:

- username

- password

o Users will be able to add a new user by inputting a:

- username

- password

o User button click to:

- login to the quiz system

- sign up as a new user

Logout System Requirements

Users of my system will be able to log out of my system from the Home page. The logout

functionality will include:

1. Clearing the variable that stores the username of the currently logged in user

2. The user is brought back to the Login page

3. A message will be displayed telling the user that they have logged out

Home screen

inputs

o User button click to:

- indicate which of the three levels the user wants to

play

- logout of the quiz system

Home screen

outputs

o Message displayed when the user logs out

Quiz System Requirements

The users will begin the quiz by choosing a difficulty from the Home page from the

choice of “Easy”, “Medium” or “Hard”, which will then take the user to the relevant Quiz

page for that level of difficulty. They will then press the “Play” button to start the quiz.

The quiz will provide the following functionality:

1. The username of the currently logged in user will be displayed at the top corner

of the page

2. When clicked, the “Home” button will allow the user to return to the Home page

3. A “Clear” button will be provided to clear the output box between successive

attempts

Page 8: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

7

4. Once the “Play” button is pressed:

a) A list of 10 questions will be randomly selected

b) Each question will be displayed one at a time in an output field on the Quiz

page

c) The list of 4 possible answers for each question will be displayed below the

question in the same output field

d) A pop-up box will be used to allow the user to enter the number of their

chosen answer

e) The number entered will then be compared with the correct answer stored in

the database

f) If the answer is correct, a message stating that they’re correct will be

displayed and one will be added to their score

g) If they’re incorrect, then the score will remain the same and a message

stating that they’re incorrect will be displayed

h) Once the quiz is finished, the score that the user achieved out of 10 will be

displayed

i) The username and score of the user will be added to the leader board file for

the chosen level of difficulty

Quiz screen inputs o User button click will be used to:

- start the quiz

- return to the Home screen

- clear the leader board display area

o Users will type their answer to each question into the pop-

up box that opens

Quiz screen

outputs

o Username of the current user will be displayed

o Each question will be displayed along with the 4 possible

answers

o Correct or incorrect message will be displayed

o The user’s quiz score will be displayed

Leader Boards Requirements

The users will be able to view a leader board for each difficulty of the quiz “Easy”,

“Medium” and “Hard”. The leader board functionality will include:

1. The username of the currently logged in user will be displayed in the top corner

2. A “Return” button will be provided to return to the Home page

3. A “Clear” button will be provided to clear the leader board display area

between displays

4. When the “Display” button is pressed:

Page 9: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

8

a) The contents of the file storing the scores for the user’s chosen difficulty will be

imported into the program and sorted in descending order

b) The top 10 scores will be displayed with the username of those who got them

Leader board

inputs

o User button click will be used to:

- display high scores and matching user names

- clear leader board display array

- return to the Home screen

Leader board

outputs

o Username of the current user will be displayed

o Sorted score and matching username on the leader

board

Project Plan

Here is my detailed project plan with list of tasks and time allocation.

Task Sub Task Duration Start Date Target Date

An

aly

sis

6 d

ay

s

Read

requirements for

AH project and

create idea

1 day 23rd Oct 23rd Oct

Write outline of

project

0.5 day 24th Oct 24th Oct

Create scope,

boundaries and

constraints

0.5 day 24th Oct 24th Oct

Create UML use

case diagram

1 day 25th Oct 25th Oct

Create user

requirements

description

1 day 26th Oct 26th Oct

Create functional

requirements

1 day 30th Oct 30th Oct

Project plan

1 day 31st Oct 31st Oct

Page 10: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

9

De

sig

n

14 d

ay

s

Interface design -

Create wireframes

5 days 1st Nov 8th Nov

Design Structure

Diagrams

2 days 9th Nov 11th Nov

Create

Pseudocode

5 days 12th Nov 19th Nov

Design SQL 2 days 20th Nov 21st Nov

Imp

lem

en

tatio

n

30 d

ay

s

Create User

Interface

5 days 28th Nov 5th Dec

Create Program

Listing

10 days 6th Dec 20st Dec

Create DB

structure

5 days 5th Jan 12th Jan

Create File

Structure

5 days 13th Jan 19st Jan

Write description

of new skills

0.5 day 19th Jan 19th Jan

Log of ongoing

testing

Ongoing through

implementation

28th Nov 20th Jan

Test

ing

8 d

ay

s

Test plan

3 days 21nd Jan 23th Jan

Carry out testing 3 days 26th Jan 28th Jan

Describe testing

encountered

problems

2 days 1st Feb 2nd Feb

Ev

alu

atio

n

2 d

ay

s

Write evaluation 2 days

8nd Feb 9th Feb

Page 11: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

10

Fin

alise

ev

ide

nc

e

5 d

ay

s

Finalise analysis 1 day 15th Feb 15th Feb

Finalise design 1 day 16th Feb 16th Feb

Finalise

implementation

1 day 17th Feb 17th Feb

Finalise testing

and evaluation

1 day 18th Feb 18th Feb

Submit 1 day 19th Feb 19th Feb

Resources Required

The resources I will need at each stage of the development are listed below.

Analysis

Microsoft Office Word 2007

Google Chrome

Gantt project 2.7

Design Microsoft Office Word 2007

Google Chrome

Implementation

Microsoft Office Word 2007 with ODBC

Livecode 9.0.0

Microsoft Office Access 2007 (connection will be achieved

used ODBC access)

Notepad

Final Testing

Microsoft Office Word 2007

Livecode 9.0.0

Microsoft Office Access 2007

Evaluation Microsoft Office Word 2007

Page 12: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

11

Marking grid

Max mark My mark

Description of the problem 2

UML use case diagram 2

Requirements specification 4

Project plan 2

Total 10 8

Once you have recorded the marks you think the candidate should be awarded, visit the Understanding Standards website: https://www.understandingstandards.org.uk/Subjects/ComputingScience/advanced to see how these compare to the actual marks awarded. You will also find a commentary explaining why these marks were awarded.

Page 13: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

12

Candidate 2 evidence

Analysis of the Problem

Description of the Problem

Project idea – Cosmetic Details Website

End users of the proposed site will be predominantly females ages 15 – 40 who have a keen

interest in make-up. In the website, users will be able to view makeup products from

selected brands and search for specific products.

The project meets the requirements of AH computing as:

It will have an appropriate interface with all user inputs being validated

Details of customers and products will be stored in a SQL database

It will make use of HTML form processing using PHP

SQL operations will be used to insert details and perform searches

Web pages in the site will be styled using external CSS

When customer login to the site, PHP session variables will be used to store their data

across multiple pages of the site

The website will adapt to different screen sizes using CSS media queries

Scope, Boundaries and Constraints

Scope

During the development of the website I will produce:

Requirements specification

Detailed design

Fully working implementation

Comprehensive test plan with a summary of the final testing

Boundaries

Due to the limited time available to develop this website, several restrictions are needed.

The registration process will be used to create new customer accounts and input

validation will be applied to all details entered to the website.

Page 14: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

13

The website will be made responsive to a different screen size by altering the size

of the browser window. It doesn’t need to be tested on different devices.

Customers will navigate the site using a horizontal navigation bar.

Constraints

Time: I have 6 months to complete my project.

Technical: I will be learning PHP during the AH course.

Costs: All the software I intend to use is open-source which means there is no cost

implication for the school.

Legal: I must comply with the Copyright, Design and Patents Act and ensure that

the GDPR Regulations are met.

UML Case Diagram

Page 15: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

14

Requirements Specification

Purpose of the site: The purpose of the website is for users to be able to view cosmetics

from selected brands when they register and log into the site.

Functional Requirements

The website will be able to store the details of customers and products in an

external database

The website will be able to validate all user inputs to the website

It will be easy to navigate with a fully functioning navigation bar

Check that users are registered when they login to the website

Pages of the website will be formatted using an external style sheet

Users will be able to search for products by brand or by product name by

connecting to the database and executing SQL queries

Display formatted search results (details of each product found, including an image

of these products)

Session variables will be used to store a customer’s login details across pages of the

website

Responsive layout that changes depending on the screen size being used

End-User Requirements

Through the analysis of my user surveys, I have come up with a list of requirements that

were the most common answers amongst the people answering my surveys:

Palatable colour scheme (e.g. light, complimentary colours)

Easy to navigate

Clutter free and good use of space

Easy to use search facility to search for products by name and/or by brand

Because of the user surveys, I will ensure to include these requirements when

implementing the website to create the best user experience I can.

Inputs and Outputs

For users: Email Addresses

First Name

Last name

Page 16: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

15

Home address

Telephone Number

Username

Password

Search criteria

For Website: Processes: Validation of all customer inputs

Open and close connection with database

Save customer details in database

Authenticate customer login

Execute SQL queries

Search for products and format query results

Use of session variables to preserve user login data

Outputs: Validation error messages

Personalised message using session variables on search

page

Search results showing product details, including an image

Inputs: Populating the website with details of makeup products

Login query results

Registration query results

Search criteria and search query results

Size of the browser window

Project Plan

Resources Required

During the development, I will need access to a computer with the following software

resources:

Page 17: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

16

Text editor

Browser

Web server tools

Page 18: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

17

De

taile

d P

roje

ct

Pla

n

Page 19: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

18

For clarity, I have repeated the tasks to be completed at each stage of the project’s development.

Tasks Est Duration (hours) Target Date

Analysis

Read requirements for AH project and create idea

Write outline of project

Scope, boundaries and constraints

UML Use Case diagram

Requirements specification – end-users

Requirements specifications – functionality

Description of inputs and output

Project planning

6 6th October 2018

Design

Interface design – wireframes

Structure diagram – website

Pseudocode (server-side tasks)

Database design

6 2nd November 2018

Implementation

Database structure

HTML pages

Navigation bar (CSS)

PHP (registration page)

PHP (login process)

Session variables

PHP (search process)

Media query

Validation (registration process)

Ongoing testing

Description of research/new skills acquired

24 15th February 2019

Testing

Test plan (requirements)

Persona and test cases

Final testing

Test evidence

10 8th March 2019

Evaluation

Fitness for purpose

Maintainability

Robustness

2 15th March 2019

Page 20: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

19

Marking grid

Max mark My mark

Description of the problem 2

UML use case diagram 2

Requirements specification 4

Project plan 2

Total 10 8

Once you have recorded the marks you think the candidate should be awarded, visit the Understanding Standards website: https://www.understandingstandards.org.uk/Subjects/ComputingScience/advanced to see how these compare to the actual marks awarded. You will also find a commentary explaining why these marks were awarded.

Page 21: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

20

Workshop 2

Design of the solution

Task

Use the marking instructions on page 6 of the Advanced Higher project assessment task

document available at https://www.sqa.org.uk/sqa/files_ccc/AHCATComputingScience.pdf to

mark the design evidence for Candidate 2. You will need to refer back to the requirements

specification in the analysis section.

You can record your marks in the grid that follows the candidate evidence in this booklet. The

total mark that was awarded for design is provided in the grid.

Page 22: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

21

Candidate 2 evidence

Design of the Solution

Media Query Design

The website should display correctly when viewed in the browser on the school’s desktop

PCs. The display should be altered when the web browser window is reduced to a width of

750 pixels. When this happens, the font sizes will be reduced, and the horizontal

navigation bar will be altered.

Browser width

Feature / Attribute Description / Setting

Full width

CSS style rule .fullScreen

H1 font size 22px

Body font size 16px

H3 font size 18px

Horizontal navigation bar

Created using ul elements inside the nav section

Display inline (.fullScreen) none (.smallScreen)

Maximum width of 750 pixels

CSS style rule .smallScreen

H1 font size 18px

Body font size 12px

H3 font size 14px

Horizontal navigation bar

Created using a select form inside the nav section

Display inline (.smallScreen) none (.fullScreen)

Page 23: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

22

User Interface Design

Page 24: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

23

Page 25: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

24

Page 26: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

25

Page 27: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

26

Session Variable A session variable will be used to store the username entered during a successful login.

The user name submitted from the HTML form will be assigned to the PHP variable

$username using $_POST

The value stored in $username will be assigned to the session variable “sessionuser”

using $_SESSION

Pseudocode for Server-side Processes

Registration Process

1. Assign connection details to PHP variables

2. Connect to database server

3. If there is an error with the connection then

4. Display error message

5. End if

6. Assign values submitted by HTML registration form to PHP variables using $_POST

7. If first name is left empty then

8. Display error message

9. Else

10. If surname is left empty then

11. Display error message

12. Else if anything other than letters is entered then

13. Display error message

14. End if

15. If address is left empty then

16. Display error message

17. End if

18. If phone number is left empty then

19. Display error message

20. End if

21. If email is left empty then

22. Display error message

23. End if

24. If password is left empty then

25. Display error message

26. End if

27. Else

Page 28: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

27

28. Create query to add customer details to database

29. Execute query to add details to the customer table

30. End if

31. Close server connection

Login Process

1. Start session

2. Assign connection details to PHP variables

3. Connect to database server

4. If there is an error with the connection then

5. Display error message

6. End if

7. Assign values submitted by HTML login form to PHP variables using $_POST

8. Assign value stored in $username to session variable sessionUser

9. Create SQL query to fetch details of customer from database (match by username)

10. Execute SQL query

11. If no records returned from the query then

12. Display account details not found message

13. Else

14. While a record is available for processing

15. If password entered = password in returned record then

16. Display personalised welcome message

17. Redirect to search page

18. Else

19. Display incorrect password message

20. redirect to login page

21. End if

22. End while

23. End if

24. Close database connection

Search Process

1. Start session

2. Assign connection details to PHP variables

Page 29: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

28

3. If there is an error with the connection then

4. Display error message

5. End if

6. Assign search criteria submitted by HTML search form to PHP variable using

$_GET

7. Create query to fetch product details matching search criteria from database

8. If no products are found then

9. Display error message stating that no products are available from that brand

10. Else

11. Display table headings

12. While a product record is available for processing

13. Display product details in table cells

14. End while

15. End if

16. Close database connection

Query Design

Registration Query

INSERT

firstname, surname, username, phonenumber, email, address, password

(all fields in the registration page)

TABLE customer

VALUES firstname, surname, username, email, address, password

(all fields in the registration page)

Login Query

SELECT everything from the customer table (use * wildcard)

FROM The customer table

WHERE username = username entered

Search Query

SELECT everything from the product table

FROM The product table

WHERE brand = brand entered

Page 30: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

29

Data Dictionary

Customer Table

Field Name Field Length/Type Required Key

firstName Varchar(15) Yes

surname Varchar(25) Yes

username Varchar(20) Yes Primary key

telephoneNumber Int(11) Yes

emailAddress Varchar(50) Yes

Products Table

Field Name Field Length/Type Required Key

productID Int Yes Primary key (auto increment)

productName Varchar(50) Yes

type Varchar(20) Yes

brand Varchar(50) Yes Restricted choice

price Float(4,2) Yes

imageFilename Varchar(20) No

Entity Relationship Diagram

- there is no need for an ERD as there is no link between my database tables

Page 31: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

30

Hierarchical Design of Website Structure

Links between pages has been indicated by the arrows in the hierarchical diagram below.

Marking grid Max mark My mark

Design of Advanced Higher concepts 6

Design of integration 4

Overall design matches requirements specification 5

User interface design 5

Total 20 13

Once you have recorded the marks you think the candidate should be awarded, visit the Understanding Standards website: https://www.understandingstandards.org.uk/Subjects/ComputingScience/advanced to see how these compare to the actual marks awarded. You will also find a commentary explaining why these marks were awarded.

Page 32: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

31

Workshop 3

Implementation

Task — Part 1

The code for Candidate 1’s project follows. With reference to pages 7 and 8 of the Advanced

Higher project assessment task document available at

https://www.sqa.org.uk/sqa/files_ccc/AHCATComputingScience.pdf, annotate Candidate 1’s

code to highlight the important sections of code for marking:

Advanced Higher concepts

Integration

User interface

It is good practice to encourage candidates to highlight these sections of code when submitting

final project evidence for marking.

Page 33: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

32

Candidate 1 evidence

Implementation code

Page 34: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

33

Page 35: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

34

Page 36: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

35

Page 37: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

36

Page 38: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

37

Page 39: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

38

Page 40: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

39

Page 41: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

40

Page 42: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

41

Page 43: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

42

Page 44: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

43

Page 45: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

44

Page 46: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

45

Page 47: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

46

Page 48: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

47

Task — Part 2

As this solution is being developed, ongoing testing will take place. Most of the ongoing testing

will involve component testing, but integrative testing will also be carried out.

Use the grid below to give examples of component and integrative testing that will be needed for

Candidate 1’s project. A completed example can be found in Appendix 1.

Component testing

Test Component to be tested Description of test(s)

1 Login validation

(1) Check that username and password cannot be null

login leave username empty

login with password empty

login with both username and

password provided

(2) Check that password entered has at least 5 characters

login with password which has only

3 characters

login with password that has 5

characters

2

3

4

Page 49: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

48

Integrative testing

Test Components being integrated Description of test

5

Quiz screen user interface (SDD)

+

Connection with database (DBDD)

Use program code to connect to database and

display temporary message to indicate either

“Connection successful” or “Not connected”

6

7

NOTE: In their log of ongoing testing, candidates should not only describe tests that were

needed. They are also expected to:

describe issues encountered during testing

describe how they resolve those issues

list any references used

Having described each test that is needed, candidates must log details of issues encountered.

This evidence could be presented as a simple table with a list of any references. For example:

Issues encountered How issues were resolved

1

I encountered several problems trying to

connect to the Access database with the

quiz questions and answers.

I researched online and found a useful

tutorial about the use of ODBC on the

LIveCode Lessons website.

2

3

References used

http://lessons.livecode.com/m/4071/l/49652-how-to-connect-to-a-database-using-odbc

Page 50: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

49

Task – Part 3

As candidates implement their solution, they are expected to implement some code that goes

beyond the requirements of the Advanced Higher course.

The research and development of new skills for Candidate 2’s project follows. Use page 8 of the

Advanced Higher Project Assessment task document available at

https://www.sqa.org.uk/sqa/files_ccc/AHCATComputingScience.pdf mark the evidence for

Candidate 2.

Page 51: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

50

Candidate 2 evidence

Implementation

New skills researched and developed

To create my final solution, I had to research skills that weren’t taught as part of the AH

course.

1) Storing and Processing Image Details

When customers use the search facility on the Search Page, I wanted the search results

to include an image of each product found. At first, I thought that I would have to store

the images as blobs but when I found the DogsToys sample website on the Coredogs

website, I realised it was possible to store the filename of the image in the Product table

rather than storing the images as blobs. This made it much easier to process the image

data and with this new knowledge, I was able to use the filename of each image with the

src attribute. As a result, I was then able to meet this requirement.

2) Server-side Validation

Although I had used client-side validation at Higher level to validate all inputs to online

forms using HTML, I wanted to use server-side validation in my project to validate all

details input to the registration process. I did some research online and found a lot of

useful information. Although I could have included a lot more complex validation, I decided

to only make use of the PHP empty() function. The reference that I found most useful was

the one on the W3School website.

References Used

1) http://coredogs.com/lesson/sample-dogtoys.html

2) https://www.w3schools.com/php/php_form_required.asp

Once you have recorded the marks you think the candidate should be awarded, visit the

Understanding Standards website

https://www.understandingstandards.org.uk/Subjects/ComputingScience/advanced to see how

these compare to the actual marks awarded. You will also find a commentary explaining why

these marks were awarded.

Page 52: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

51

Workshop 4

Testing the solution

Task 4

The test plan for final testing should be comprehensive to ensure that the solution meets all the

requirements identified at the analysis stage. It should include:

all requirements

a description of the tests to be carried out

a persona and test cases to test the solution with an end user

Use the grid on the next page to describe a suitable persona and test cases that could be used

during final testing of Candidate 1’s project. A completed example can be found in Appendix 2.

Page 53: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

52

Testing the solution

Persona and test cases to be used for final testing

Persona to be used for final testing

Test cases to be used with the persona

Test case Description of task to be performed by test participants

1

2

3

4

Page 54: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

53

Workshop 5

Evaluation of the solution

Task 5

Use the marking instructions on page 10 of the Advanced Higher project assessment task

document available at https://www.sqa.org.uk/sqa/files_ccc/AHCATComputingScience.pdf to

mark the evaluation evidence for Candidate 2. You will need to refer back to the requirements

specification in the analysis section.

You can record your marks in the grid that follows the evidence. The total mark that was

awarded for evaluation is provided in the grid.

Page 55: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

54

Candidate 2 — Evaluation of the solution

Fitness for Purpose

The results of testing show that the completed project now meets all of the original

requirements, functional as well as end-user requirements. Users can register with the

site, login using their registration details and search for cosmetic products. All inputs to

the site have been validated as per the requirements of an AH project. Testing with the

persona and test cases showed that participants were able to successfully complete all

tasks given to them. I carried out all of the tests listed in my test plan and produced

evidence for each of the test cases in the plan. I am confident that my solution meets all

of the requirements listed in the requirements specification.

Original Requirements (Functional and End-user) Completed

Store details of customers and products in an external database Validate all user inputs to the website Easy to navigate with a fully functioning navigation bar Clutter free layout with palatable colour scheme Pages formatted using an external style sheet Search for product by brand or by product name Display formatted search results Session variables used to store a customer’s login details across pages of the website

Responsive layout that changes depending on the screen size being used

Maintainability

I believe that my solution is maintainable. I have used meaningful variable names for each

HTML input element and also for the PHP variables and the database fields. I have added

comment lines on each of my HTML pages to explain the purpose of each input element.

Page 56: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

55

Here is a screen-shot showing some of the commentary used in the product.html script.

On my PHP pages, I have used lots of white space to split the code into several sections

that each perform one server-side side. An internal comment at the start of each section

makes it easy for other developers to read the code and understand what each section of

code is doing. I have also used internal comments to explain the purpose of each PHP

variable. This is a screen-shot from the products.php script used to process the search

feature of the website.

It would have been possible to make use of functions to perform some of the processing

on each page. For example, I could have used a function to validate the form input on the

registration form but instead, I simply added the validation code to the body of the page.

Because of this, my solution is not modular.

I used external CSS to style each page of the website. This means that if any corrective,

adaptive or perfective maintenance is required in the future, it will be easier and much

less repetitive for developers to edit or change the formatting details because they are

held in a single file.

Page 57: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

56

Robustness

The registration page of my website is robust as every single input is validated using

server-side code. When creating a new account, the user must provide each one of the

required details otherwise an error message will appear telling the user that the detail is

required. The code used to do this validation is part of the registration.php script. Here is

a small section of that code.

When I was work on the implementation, I realised that it was taking me longer that I

expected to create working code. In the end, I decided to focus on building a working

website. Although I managed to get the login and search features of my website to work

correctly, I didn’t have time to add similar validation code to the login.php and product.php

scripts.

Marking grid

Max mark My mark

Fitness for purpose 3

Maintainability and robustness 2

Total 5 4

Once you have recorded the marks you think the candidate should be awarded, visit the

Understanding Standards website

https://www.understandingstandards.org.uk/Subjects/ComputingScience/advanced to see how

these compare to the actual marks awarded. You will also find a commentary explaining why

these marks were awarded.

Page 58: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

57

Workshop 6

Ensuring projects meet the Advanced Higher criteria

Task

Referring to pages 14–19 of the Advanced Higher project assessment task document available

at https://www.sqa.org.uk/sqa/files_ccc/AHCATComputingScience.pdf, consider the project

outlines which follow. These outlines do not fulfil the Advanced Higher project requirements.

Use the grids provided on each page to:

add details needed to satisfy Advanced Higher project criteria

identify areas of main content and Advanced Higher Constructs

identify area of integration

Examples of the details that could be added to the three project outlines below can be found in Appendix 3.

Page 59: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

58

Project 1 outline

This project will develop a database for a driving school. Each of the driving school instructors

has sole use one of the driving school cars and each hourly lesson booked is with one instructor

at a given time. Clients will be able to book individual lessons or blocks of lesson.

Once completed, the solution will:

store details of clients, lessons, instructors and cars in four linked tables of a related

database

allow clients to book one lesson at a time, or book a block of five or ten lessons; the more

lessons a client books in advance, the less they will be charged per hour for a lesson.

As it stands, this outline does not satisfy the AH project requirements. Use the grid below to:

1. add details to this outline to ensure that it does meet the AH project requirements.

2. circle the main area of the course and two AH constructs that would be covered by the

complete project outline

3. circle the area of integration covered by the complete project outline

4. identify the AH constructs and integration content required

Additional details

The solution will also:

Main area of content SDD DDD WDD

AH construct 1

AH construct 2

Area of integration SDD DDD WDD

Integrated content

Page 60: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

59

Project 2 outline

This project will develop a game of ‘Concentration’. The aim of the game is to match pairs of

initially hidden images. To complete the game successfully, the player must match each pair of

images. Players click on a cell to see what it is and then click on one of the other cells to try and

match it. If the images match, they will remain visible; if not, they will flip back over.

Once completed, the solution will:

control the game play

count the number of clicks needed to complete the game

As it stands, this outline does not satisfy the AH project requirements. Use the grid below to:

1. add details to this outline to ensure that it does meet the AH project requirements.

2. circle the main area of the course and two AH constructs that would be covered by the

complete project outline

3. circle the area of integration covered by the complete project outline

4. identify the AH constructs and integration content required

Additional details

The solution will also:

Main area of content SDD DDD WDD

AH construct 1

AH construct 2

Area of integration SDD DDD WDD

Integrated content

Page 61: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

60

Project 3 outline

This project will develop a website that can be used by teachers to post details of homework

and assignments. Parents and students will be able to search the site to display details of

relevant homework tasks.

Once completed, the solution will:

allow teachers to create new user accounts

allow registered teachers to post details of new homework assignments

allow all users to search the site to display details of relevant homework assignments

As it stands, this outline does not satisfy the AH project requirements. Use the grid below to:

1. add details to this outline to ensure that it does meet the AH project requirements.

2. circle the main area of the course and two AH constructs that would be covered by the

complete project outline

3. circle the area of integration covered by the complete project outline

4. identify the AH constructs and integration content required

Additional details

The solution will also:

Main area of content SDD DDD WDD

AH construct 1

AH construct 2

Area of integration SDD DDD WDD

Integrated content

Page 62: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

61

Appendix 1

Component testing — completed example Many different examples of component and integrative testing are possible. A few examples of

these have been provided below.

Additional examples of component testing

Test Component to be tested Description of test(s)

1 Quiz scoring system

Complete all questions in the easy

testing:

(1) Answer all questions correctly

(2) Enter the wrong answer for every

question

(3) Answer four questions correctly

2 Communication between

quiz program and login file

Use the sign-up feature to create a new

username and password combination.

Use Notepad to open the login file and

check that the new username and

password have been added.

3 Sort leader board in

descending order of score

Import details of the easy leader board

file into an array of records, sort the array

in descending order then display the

entire contents of the array on the leader

board page.

4

Database query used to

retrieve quiz questions

and answers executes

correctly

Execute SQL query to display the details

of all easy questions (the question

wording, the four possible answers and

the correct answer) in the SQL window of

MS Access.

Additional examples of integrative testing

Test Component being

integrated

Description of test

5

Quiz screen user interface

(SDD)

+

Execution of database

query (DBDD)

Use program code to execute SQL

query to retrieve all details of the first

easy question, then display these details

on the quiz page.

6

Quiz screen user interface

(SDD)

+

Format query results

(DBDD)

Use program code to execute SQL query

to retrieve all details of all easy

questions, then display these details one

at a time on the quiz page.

Page 63: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

62

Appendix 2

Testing the solution — completed example

Persona and test cases to be used for final testing

Sample persona to be used for final testing

Karmal is an S4 pupil who is studying five N5 subjects: English, Maths, History,

Spanish and Biology.

He has been doing some personal revision for his prelims. For most of this

revision, Karmal has been revising questions to practise his written answers. He

would like to use the quiz to test his knowledge and recall of historical facts.

Although Karmal is a confident user of computers, he doesn’t have any detailed

technical knowledge to help him understand what to do when things go wrong.

Sample test cases to be used with the persona

Test case Description of task to be performed by test participants

1

Use the sign-up feature of the quiz to create a new account.

You can choose any username but the password you use must

have at least 5 characters. Make a note of the username and

password because you will need them later.

2

Use the login facility to login using your own username and

password.

Answer the first three questions of the hard quiz then return to the

home page.

3 Play the easy quiz by answering all of the questions then view the

easy level leader board.

4 Clear the leader board display area then return to the home page

and log out of the quiz.

Page 64: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

63

Appendix 3

Project 1 outline

Examples of details that could be added to the project outline have been provided below. These

additional details fulfil the criteria of a DDD focused project and provide the integrated content

that is a requirement of all Advanced Higher projects.

Although it would be possible to integrate the DDD content with WDD, the suggestions here

refer to integration with SDD content.

Additional details

The solution will also:

display details of all clients who have booked more

than eight lessons

display details of any instructors who do not have

any lessons booked

display details of all lessons booked for a

particular date

provide an interface to:

o display formatted query results

o generate form that gather booking details

from clients

Main area of content SDD

WDD

AH construct 1 Creation of a relational database with four linked

tables

AH construct 2

Queries and subqueries that make use of logical

operators NOT and EXISTS to query across at least

three tables

Area of integration

DDD WDD

Integrated content

Use programming code to interface with relational

database

Open/close connection with SQL database

Use programming code to execute SQL queries

User programming code to format query results

DDD

SDD

Page 65: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

64

Project 2 outline Examples of details that could be added to the project outline have been provided below.

These additional details fulfil the criteria of a SDD focused project and provide the integrated

content that is a requirement of all AH projects. The suggestions refer to integration with DDD

content.

Note that it would be possible to implement a solution where the main focus was WDD as an

alternative to the SDD solution suggested here.

Additional details

The solution will also:

ask the player to enter a player name at the end of

each game

display the total number of clicks needed to

complete each game

store the total clicks with the player’s name

provide an option to view a leader board of total

clicks with matching user names

display the leader board details in ascending order

of total clicks

Main area of content

DDD WDD

AH construct 1 Use of a programming language to store and process

image details in a 2D array

AH construct 2 Insertion sort algorithm will be used to arrange leader

board from least to most total clicks

Area of integration SDD

WDD

Integrated content

A database table will be used to store the leader

board details

Program code will open/close connection with the

database server

Program code will execute a SQL query to retrieve

leader board details from the database

Program code will be used to format results of the

SQL query

SDD

DDD

Page 66: Computing Science (Advanced Higher) · 1. I will use LiveCode version 9 to create the quiz because I have several years’ experience using this language 2. The final solution will

65

Project 3 Outline

Examples of details that could be added to the project outline have been provided below.

These additional details fulfil the criteria of a WDD focused project and provide the integrated

content that is a requirement of all AH projects. These suggestions refer to integration with DDD

content.

Additional details

The solution will also:

respond to different screen sizes by displaying

alternative layouts

retain teacher login details so they can be added

to the post details and avoid having to enter them

again

allow users to search by selecting the relevant

year group, subject and teacher

Main area of content SDD DDD

AH construct 1 Form processing using PHP with session variables

AH construct 2 External style sheet that includes media queries

Area of integration SDD

WDD

Integrated content

Store user account and post details in database

tables

Open/close connection with database server

Execute SQL queries

Format query results

WDD

DDD