By: CS2103T-F14-1
Since: Aug 2019
Licence: MIT
- 1. Introduction
- 2. Quick Start
- 3. Overview
- 4. Before you start
- 5. Features
- 5.1. Access Help Tab:
help
- 5.2. Access Dashboard:
dashboard
- 5.3. List all questions:
showall
- 5.4. Adding bookmark:
bookmark
- 5.5. Removing bookmark:
deletebookmark
- 5.6. Find question by title :
find
- 5.7. Browse by keywords:
browse
- 5.8. Viewing the problem statement :
view
- 5.9. Attempting a question :
attempt
- 5.10. Submitting your answer:
submit
- 5.11. Creating a new note:
newnote
- 5.12. Saving changes to a note:
savenote
- 5.13. Opening an existing note:
opennote
- 5.14. Deleting an existing note:
deletenote
- 5.15. Loading new questions:
loadquestions
- 5.16. Exit the application:
exit
- 5.1. Access Help Tab:
- 6. FAQ
- 7. Command Summary
- 8. Question storage file format
- 9. Format for Custom Questions
1. Introduction
Duke Academy is a coding practice platform that operates entirely on your local machine without the need for an internet connection. Whether you are revising for a test, practicing for a tech interview, or just coding for the sheer joy of it, DukeAcademy gives you access to a wide range of programming problems from various categories. Easily find something that suits your needs and interests and start honing your skills today!
Duke Academy features a built-in list of problem sets and its very own text editor. Simply choose a problem statement that catches your eye, load it up in the problem display panel and start coding away! Duke Academy also features your very own profile page for you to immediately view all of your accomplishments at a glance. Your profile page also helps you keep track of the problems that you have attempted and those you have bookmarked, so that you can get back to them easily at a later time.
For educators, you can use Duke Academy as a platform to administer your assignments or practice questions. If you have questions of your own you would like to test your students, you can use the built-in question loader in DukeAcademy to set your own questions and then distribute the updated questionBank.json file to your students through your favourite communication channels.
Duke Academy is optimized for those who prefer to work with a CLI (Command Line Interface) while still enjoying the benefits of a GUI (Graphical User Interface). If you are unfamiliar with using a CLI (which is an important skill for all programmers), you can get used to it while working on your coding skills here in DukeAcademy!
2. Quick Start
-
Ensure you have Java 11 or above installed in your Computer.
-
Download the latest DukeAcademy.jar here.
-
Double-click the .jar file to start the app. The GUI should appear in a few seconds. If the app cannot be launched by double-clicking:
For Windows:
-
Launch Notepad (or any text editor), then copy and paste the following line into the text editor.
java -jar [name_of_file].jar
-
Replace "[name_of_file]" with whatever name you have saved the .jar file as.
-
Save the text file as a .bat file in the same location as the .jar file.
-
Then double-click on the newly created .bat file to run the app.
-
-
When launching the app for the first time, it will create a folder named DukeAcademy in the directory where your jar is located.
-
This folder will contain all of your app’s data. To fix any errors related to corrupted data, delete this folder and the app will be reinstalled.
image::quickstart1.png[width="800" align="center"]
-
-
Once the app is launched, you will immediately be greeted with the main User Interface of the app.
The User Interfaces that are important for now:
-
Command Box
This will be the field where you input all your commands. After you press the Enter button, your command will be executed.
e.g. typing
showall
, followed by pressing Enter will display all the questions in the app.To find out about the commands available in Duke Academy, please visit Section 5, “Features”.
-
Result Box
Once you have executed a command, a feedback will be displayed in this field.
e.g. after executing
showall
command, "List all questions…" will be displayed. -
Tab Panes
Consists of 5 different tabs: Home, Questions, Workspace, Notes and Help
-
-
After executing
showall
in the CommandBox, find a question that interests you and typeattempt [Qn Index]
into the CommandBox to start your DukeAcademy experience.Note: the index of a question is the number displayed next to its title.
3. Overview
The application is divided into 5 separate tabs, each one of them serving a specific purpose. You can toggle between the
different tabs by entering tab
into the CommandBox.
3.1. Dashboard Tab
The Dashboard allows you to keep track of your learning journey and progress made in Duke Academy.
On the Dashboard you can:
-
See the percentage of questions you completed and your current skill tier.
Novice 0 - 29 %
Apprentice 30 - 49 %
Master 50 - 69 %
Grandmaster 70 - 89 %
Duke 90 - 100 % -
Keep track of the questions that you are currently attempting.
-
Keep track of the questions that you bookmarked.
3.2. Questions Tab
The Questions tab contains a list of all the available questions and also a window to view your problem statements.
You can use commands such as browse
and find
to filter through the list of questions in order to find what you
are looking for. browse
can lookup any keywords in titles, difficulty, description, topics, etc. find
only finds by titles. (View Section 5, “Features” for more details.)
-
To quickly see all questions, enter
showall
into the CommandBox. -
To view the problem statement for a question, enter
view <Qn Index>
. The problem statement will then be displayed on the right.
3.3. Workspace Tab
The workspace is where you will work on the various questions.
-
Problem Statement Display
Displays the question that you are currently attempting.
-
Program Evaluation Panel
This panel displays the correctness of your program when evaluated against the pre-defined list of test cases tied to the question you are solving.
-
Editor
A built-in editor for you to write your code.
-
To submit your attempt, enter
submit
into the CommandBox. -
To begin your attempt on a question, enter
attempt <Qn Index>
into the CommandBox. -
To submit your attempt, enter
submit
into the CommandBox.
3.4. Notes Tab
The notes page is where you can record notes or even sketch out some of your ideas to aid your learning process.
-
NotesListDisplay
Displays all of the notes that you have previously created.
-
CurrentNoteTitle
Shows the title of the note that you are currently viewing/editing.
-
NoteTextInput
Input space for any text-based notes that you wish to record.
-
Sketchpad
A canvas for you to draw any ideas you may have pertaining to data structures!
-
To create a new note, enter
newnote <Title>
into the CommandBox -
To open an exiting note, enter `opennote <Id> into the CommandBox.
-
The id of the note is the number that appears next to the title in the NotesListDisplay.
-
To save any changes to your notes, enter
savenote
into the CommandBox.
3.5. Help Tab
The help tab is where you can get a quick overview of commands used in Duke Academy, and the URL to the official User Guide.
4. Before you start
-
The evaluator searches for a class with the class name
Main
as the entry point into your program. Please ensure that you declare your main method in a class calledMain
. -
The program evaluator uses stdin to feed your program inputs and stdout to receive your program’s outputs. Thus, it is important that your program uses the
Scanner
class to read inputs and for you to print your results. -
Take note that your program is being evaluated on your local machine and not within a container or a virtual machine. Thus, do not write any code that you would not want to run on your local machine.
-
Most importantly, remember to have fun!
5. Features
Command Format
-
Commands are entered into the CommandBox
-
Words within square braces
[]
are the parameters to be supplied by you, the user.e.g. in
attempt[id]
,id
is a parameter which can be used asattempt 1
. -
Parameters are compulsory.
-
Parameters with
…
after them can accept multiple entries.e.g.
browse [category]…
can be used asbrowse easy linkedlist hashtable recursion
(i.e. 4 entries), etc.
5.1. Access Help Tab: help
Navigates to the Help Tab.
The Help tab contains a quick overview of commands used in Duke Academy, and also the URL to the official User Guide.
Format: help
5.2. Access Dashboard: dashboard
Navigates to the Dashboard Tab.
The Dashboard allows the user to keep track of his learning journey and progress made in Duke Academy.
Format: dashboard
5.3. List all questions: showall
Navigates to the Questions Tab and displays all available questions.
Format: showall
5.5. Removing bookmark: deletebookmark
Removes the bookmark from a specific question.
Format: deletebookmark [id]
5.6. Find question by title : find
Searches for question of which the title contains strictly the keywords entered.
Format: find [keyword]…
Examples:
-
find binary search tree
Finds and displays all questions containing the substrings "binary", "search" and "tree" in their title. -
find fizz buzz
Finds and displays all the questions containing the substrings "fizz" and "buzz" in its title, but not questions with titles such as "fizzbuzz".
5.7. Browse by keywords: browse
Searches through all questions with the specified keyword(s). A question is listed as a search result as long as it contains one of the keyword(s) in their title, topics, description, status or difficulty.
Format: browse [keywords]…
Examples:
-
browse hashtable linkedlist
Finds and displays all questions that contain "hashtable" and "linkedlist". -
browse number
Finds and displays questions that contain strictly the keyword "number".Questions that do not and instead contain words with "number" as a substring of a word in their title, topics, description, status or difficulty will not be displayed.
5.8. Viewing the problem statement : view
Displays the problem statement of the question.
Format: view [id]
Examples:
-
view 1
Displays the question with the id "1" in the right side window of the GUI, as shown in the above picture.
5.9. Attempting a question : attempt
Navigates to the Questions tab where you can code your solution to solve the problem statement.
Format: attempt [id]
5.10. Submitting your answer: submit
Submits your solution. Your code will be compiled and run against test cases. The results will be displayed in the ProgramEvaluationDisplay on the bottom left of the GUI.
Format: submit
5.11. Creating a new note: newnote
Navigates to the Notes tab and creates a new note with the given title.
Format: newnote [title]
Examples:
-
newnote Linked Lists
Creates a new note titled "Linked Lists" and loads it into the Notes page for you to edit/view.
5.12. Saving changes to a note: savenote
Navigates to the Notes tab and saves any changes made to the note that you were previously viewing/editing.
Format: savenote
5.13. Opening an existing note: opennote
Navigates to the Notes tab and opens the note corresponding to the id for viewing/editing.
Format: opennote [id]
-
opennote 1
Navigates to the Notes page after opening the note with the id 1.
5.14. Deleting an existing note: deletenote
Navigates to the Notes tab and deleting the note corresponding to the id.
Format: deletenote [id]
-
deletenote 1
Navigates to the Notes page after deleting the note with the id 1.
5.15. Loading new questions: loadquestions
Imports new questions into the application through a text file.
Format: loadquestions [filename]
Examples:
-
loadquestions my_problem_set.txt
Loads the questions from the file "my_problem_set.txt" located in the../DukeAcademy/newQuestions/
directory.
We have prepared a dummy problem set for you to try out as shown in diagram below.
Type loadquestions NewProblems.txt
(case sensitive), and
two new questions titled Apple
and Banana
will be loaded onto Duke Academy.
6. FAQ
Q: How do I transfer my own problem sets to another computer?
A: Copy the problem set text file into DukeAcademy’s home folder on the other computer and repeat the loadquestions command.
Q: How do I transfer data to another computer?
A: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous DukeAcademy folder.
Q: What is the format of problem setting?
A: It should contain the following: problem statement, input and output files, difficulty level, solution, as well as algorithm category. Check out Section 9, “Format for Custom Questions” for detailed reference.
Q: What if I want to delete questions?
A: Currently there is no delete question feature implemented. To restore to default setting, delete the DukeAcademy
folder located at the same directory as the DukeAcademy.jar
, and restart the app.
7. Command Summary
-
Home:
home
-
List all questions:
showall
-
Adding bookmark:
bookmark [id]
-
Removing bookmark:
deletebookmark [id]
-
Find by question title:
find [keyword]…
-
Browse by category:
browse [keyword]…
-
View:
view [id]
-
Attempt a question:
attempt [id]
-
Submit:
submit
-
Load questions:
loadquestions [filename]
-
Create a new note:
newnote [title]
-
Save current note:
savenote
-
Open a note:
opennote [id]
-
Delete a note:
deletenote [id]
-
Switch tab sequentially:
tab
-
Exit:
exit
9. Format for Custom Questions
-
Create a .txt file.
-
The format of a question goes like follows:
Question::
Title::
Description::
Difficulty::
Topics::
TestCase::
Input::
Output::
-
All inputs must be in the order stated above.
-
Title, Description can be any non-empty string.
-
Difficulty can only be
EASY
,MEDIUM
orHARD
. (Must be capitalized) -
Topics can only be
ARRAY
,LINKED_LIST
,HASHTABLE
,TREE
,GRAPH
,RECURSION
,DIVIDE_AND_CONQUER
,DYNAMIC_PROGRAMMING
,SORTING
, orOTHERS
. (Must be capitalized) -
One question can only have one title, description and difficulty. It can have multiple topics separated by
,
. It can have multiple test cases, each begin with aTestCase::
identifier. -
For sample questions, refer to the
../DukeAcademy/newQuestions/NewProblems.txt
file.