ExamBank Scot · AH Computing Science question bank · All AH Computing Science questions
15 marks · UML use case diagrams
Requirements for the updated website are listed below. The updated website will allow all users to: • access a maximum of five free articles every month • search for articles over 12 months old • subscribe to the full service using a secure payment system The updated website will allow subscribed users to: • log-in to gain access to the full service • access any number of articles • search for articles without restriction • renew their subscription at a reduced rate using a secure payment system Draw a use case diagram to represent these requirements. Two designs for the human computer interface (HCI) of the search facility for the updated website are produced. The two designs are shown. Design 1 Design 2 Article Search 2014 MAY Article Search dd/mm/yyyy DATE FROM TOPIC TOPIC YEAR DATE TO dd/mm/yyyy MONTH Users must type the topic and then either type the date in the required format or select the date from the calendar. Users must type the topic and then select the year and month by using the spinners. Discuss the suitability of each design for use with a smartphone or tablet device. During testing of the search facility, the following list of articles is produced. Article Title Summary Date Issue Processors Recent processor development 06/05/2016 214 Printers Inkjet or Laser? 25/03/2016 208 Smartphones Control your phone by thought 13/05/2016 215 Describe how an insertion sort would reorder the three articles above, listing the articles in chronological order with the most recent article first. An HTML form is used to subscribe to the full service. Part of this form is shown. Please enter a username (6 to 15 characters): Please enter a password (4 to 8 characters): Submit Form The server-side script called “subscription.php” will receive data from the HTML form. Write the HTML tags used to generate the subscription form shown above. Having received the HTML form data, the server-side script “subscription.php” then executes a number of processes. The script 1. assigns the HTML username and password to server-side variables 2. creates a connection with the database server 3. adds data to “member” table of the “subscribedata” database 4. closes the connection The name of the database server is “magserver” and the username is “subscribe” with the corresponding password “subpass”. Using pseudocode or a server-side scripting language with which you are familiar, write code for processes 1, 2, 3 and 4 described above. The owners of a monthly magazine decide to update the company website. The current website allows users to access online versions of articles printed in the monthly magazines.
1 mark for user and subscribed user actors 1 mark for 7 bulleted use cases 1 mark for any additional feature of a use case diagram eg associations (include, extend, inherit), actor representing payment external system, etc. Answers relating to the appropriate nature of the interface design in relation to user experience of the website when accessed from user’s smartphone or tablet. Accuracy of information entered Both interfaces have a topic option which requires text input; this provides flexibility in terms of topic to be searched but potential for misspelling of topic exists. Selection of data from a small calendar on a smartphone may be fiddly but will be more accurate than typing it in the correct format. Less strain on resources Easier to understand interfaces means a user will complete tasks more quickly thereby freeing resources more quickly (servers etc.) Less training and help needed Users are less likely to rely on documentation or help centres, reducing running costs. Other answers possible. 1 mark each for any two relevant comments Answers must relate to user entry of topic and date using a smartphone or tablet. (b) Correct description of sort – • Date/Issue 1& 2 compared, no swap • Date/Issue 3 &2 compared, swap • Date/Issue 2 &1 compared swap. 2 marks for all 3 correct; 1 mark for any 2 correct. Award max of 1 mark for correct description of insertion sort that doesn’t refer to the scenario. One possible solution is provided below. Many possible alternatives exist. <FORM method="post" action="subscription.php" name="subscription" > Please enter a username (6 to 15 characters): <INPUT type="text" name="username" > Please enter a password (4 to 8 characters): <INPUT type="password" name="userpassword"> <INPUT type="submit" value="Submit Form" name="submit" > </FORM> Submit button alternative <BUTTON type=""submit">Submit Form</BUTTON> 1 mark for correct structure of <FORM> tag with method set as POST and action set to the correct file name. 1 mark for correct structure of <INPUT> tags used for username and password. Type attribute must be text for username; accept either text or password type for password. 1 mark for correct structure of <INPUT> tag for submit button; type must be correct; value must be correct. Note that type could be ‘button’ or ‘submit’. Correct use of <BUTTON> tag as an alternative to this should receive 1 mark. One possible PHP solution is provided below. Many acceptable alternatives exist. $user=$_POST['username']; $userpassword=$_POST['userpasswor d']; $dbserver='magserver'; $dbuser='subscribe'; $dbpass='subpass'; $dbname='subscribedata'; $connection = mysql_connect($dbserver,$dbuser, $dbpass); mysql_select_db($database,$connec tion); $sql="INSERT INTO member VALUES ('$user', '$userpassword')"; mysql_query($sql); mysql_close($connection); Many alternative solutions are possible. 1 mark for assignment of both HTML values. (Step 1) 1 mark for correct use of connection parameters; 1 mark for connection to server and selection of database (mysql_connect and mysql_select_db code) (Step 2) 1 mark for SQL query (Step 3) 1 mark for close (Step 4) Notes • query and connection need not be assigned to variables • form data does not need to be validated • connection does not need to be checked