Ask a question to Desklib · AI bot


Graphical User Interface: Assignment

Added on -2019-09-16

| 6 pages
| 2354 words

Trusted by 2+ million users,
1000+ happy students everyday

CP1404/CP5632 2016 SP53 Assignment 2 – Reading List 2.0 Task:Create a Graphical User Interface (GUI) version of the program you made in assignment 1, usingPython 3 and the Kivy toolkit, as described in the following information and accompanyingscreencast. This assignment will help you build skills using classes and GUIs as well as giving youmore practice using techniques like selection, repetition, exceptions, lists, file I/O and functions. Somerequirements have in-text references like [0] that refer to the resources list near the bottom. Everythingyou need to know to complete this assignment can be found in the subject materials.Program Overview:Ensure that your program GUI has the following features, as demonstrated in the screenshots:the left side of the screen contains buttons for the user to choose actions from, and text entryfields for inputting information for a new bookthe right side contains buttons for each of the books, colour-coded based on their lengththe status bar at the top of the right side shows the number of pages to read or completedthe status bar at the bottom of the right side shows messages about what to do, or when in listcompleted mode, shows the book's details when a book is clicked on“List Required” is the default (starting) state and shows the books that are required; clicking anitem in this state marks it as completed (the button will immediately disappear)“List Completed” changes the right side view to show books that have been completed (nolength-based colouring); clicking an item in this state shows its details in the bottom status barthe user can add a new book by entering text in the input fields and clicking “Add Book”the exact style (including colours) is up to you, but ensure that all functionality is readilyaccessible with your chosen GUI styleProgram Functionality Details:The main program will be done in a Kivy App subclass in There will be no main()function, but rather your program will run() the Kivy app in the same way as you've seen inour example programs. [1, 2]The program starts by loading the same CSV (Comma Separated Values) file of items as inyour first assignment. This should be done with a method of your main app class and will besimilar to the code for the first assignment, but will save the books as Book instances in aBookList (see below for more details).The books file is saved when the program ends, updating any changes made with the app bythe user (adding new books or marking them as completed).Adding:CP1404/CP5632 2016 SP53 Assignment 2 © 2016 – Information Technology @ James Cook University1/6
All fields are required. If a field is left blank, the bottom status bar should display “Allfields must be completed” when “Add Book” is clicked.The pages field must be a valid integer. If this is invalid, the status bar should displayPlease enter a valid number”.Pressing the Tab key should move between the text fields. (popup_demo from [1])When the user successfully adds a book, the fields should be cleared and the book shouldappear in the required reading list. (dynamic_widgets from [1])When the user clicks the “Clear” button, all text in the input fields should be cleared.Coding Requirements:Start your work by clicking cloning this repository: should clone this using PyCharm. After cloning, you could create the repository in your Github.From PyCharm, Select VCS -> Import Into Version Control -> Share Project on Github.** Ensure the repository is private upon creation.This will give you a new repo containing starter code files and a README for your reflection.At the very top of your file, complete the comment containing your details.Make use of named constants where appropriate. E.g. colours could be constants.Use functions/methods appropriately for each significant part of the program. Remember that functions should “do one thing”.Use exception handling where appropriate to deal with input errors.Use app.kv file for your GUI design. Creating the book buttons should be done from Python (, not in the kv file, since it will be dynamic. (dynamic_widgets from [1])Document your classes and methods clearly with docstrings. Include inline/block comments asappropriate. You do not need comments in the kv file (but you can if you wish). You do not need any pseudocode (but you can write some if you wish).ClassesA significant part of this assignment is to learn how to use classes to create reusable data types that simplify and modularise your program. In future, you will design your programs by choosing your own classes, but for now we will tell you what classes to create. It is important that you create these classes first, before any code that requires them. This is good coding practice. You should write and then test each method of each class – one at a time.Note: some incomplete test code (in and has been provided for you as astarting point. [3]Use a class for Book (in This should be a simple class with the required attributes for a book and four methods: __init__, __str__ (used when displaying book details in the status bar) and: oa method to mark the book as completedoa method to determine if the book is long (500 or more pages)Use a class for BookList (in It should contain a single attribute, a list of Book objects, and at least the following methods:oget book by title – take in a title (string) and return the Book object with that title; this will be useful when handling book button clickingoadd book – add a single Book object to the book list attributeoget total pages for required booksoget total pages for completed booksoload books (from csv file into Book objects in the list)osave books (from book list into csv file)osort (by author then number of pages) [4]CP1404/CP5632 2016 SP53 Assignment 2 © 2016 – Information Technology @ James Cook University2/6
The starter code includes two files with incomplete code for testing your classes. You are not marked on completing these, but it is good practice and very helpful to write tests as you develop your Book and BookList classes. GUI Requirements:The functionality can be achieved with a variety of GUI styles and colour schemes. You are welcome to customise the GUI, but it should do everything required and match any constraints specified.Project Reflection:It is important that you start developing good coding and working practices, so you are required to complete a short but thoughtful reflection on this project. Complete the template provided in the README of your repo reflect on what you learned regarding both coding and your process. Note thatthis is worth significant marks, so allocate significant time to it. We expect answers that show some detail and thought, not just trivial statements.Git/GitHub:You must use Git version control with your project stored in the private repository on Github.You are assessed on your use of version control including commits and commit messages, using imperative voice (like "add X" not "added X"). [5]Submission:Submit a zip file containing the entire project directory, including all code (.py, .kv, .csv), your projectreflection README, PyCharm project files and the .git directory (just zip up your project/repo directory). Please name the file like: e.g. if your name were Miles Davis, the filename would be Submit your single zip file by uploading it on LearnJCU under Assessment (click on the title of the assignment).Due:Submit your assignment bythe date and time specified on LearnJCU.Submissions received after this date will incur late penalties as described in the subject outline.Integrity:The work you submit for this assignment must be your own. You are allowed to discuss the assignment with other students and get assistance from your peers, but you may not do any part of anyone else’s work for them and you may not get anyone else to do any part of your work. Programs that are detected to be too similar to another student’s work will be dealt with promptly according to University procedures for handling plagiarism.If you require assistance with the assignment, please ask usingthe appropriate channels, including talking with your lecturer or tutor.Sample Output:Screenshots have been provided above. In addition, you should study the screencast provided with thisassignment to see how the GUI program should work including what the messages should be.References – Resources from Subject Materials:1.KivyDemos. Lecture Notes. 3.Chapter 15 - Testing. 4.attrgetter from Chapter 11 - Classes CP1404/CP5632 2016 SP53 Assignment 2 © 2016 – Information Technology @ James Cook University3/6

Found this document preview useful?

You are reading a preview
Upload your documents to download
Become a Desklib member to get accesss

Students who viewed this