QSH is the interactive shell for playing quizzes through the macOS Terminal.
It is built on top of SwiftQuiz which provides the core functionality for making and playing quizzes in Swift. QSH provides the UI for accessing all of that functionality using the macOS Terminal.
⚠️ Work In Progress
This package is considered work in progress until reaching version 1.0.0.
qsh package-quiz --input file://<path to quiz JSON> --encrypt-package --key <encryption key> --output file://<path to quiz package>
Note: To generate an AES-256 encryption key use a site such as this one.
Encrypted / Unencrypted Quiz Packages
QSH allows quizzes to be encrypted so that the answers contained within the quiz package cannot be readily be accessed preventing cheating. Use of this feature is optional as quiz packages may be encrypted or unencrypted. In order to encrypt a quiz during packaging, supply a AES-256 key generated using a site such as the one here using the --key parameter. If the --key parameter is omitted then an unencrypted quiz package will be generated.
Picture Rounds
To include a picture round as part of a quiz, include the parameter image as part of a short answer, multiple choice or multiple answer question. The value of the image parameter should be the URL (either a file URL or HTTP URL) of the image file. When the quiz is packaged, the image data will be included as part of the quiz package so that the images do not need to be downloaded separately at runtime.
Automatic Marking
In order to enable automatic marking for a quiz, add the following to your quiz JSON file:
Note: The key parameter is only required for encrypted packages.
Help
qsh --help
Or to get help on a specific subcommand:
qsh package-quiz --help
qsh play-quiz --help
Developing a Quiz Client
The core functionality for packaging and playing quizzes is implemented by the Swift Quiz package with QSH providing the UI for the macOS Terminal. Should you wish to build your own client for playing quizzes e.g. using Linux, in theory you could do so using Swift Quiz.
Connectivity - Improves on Reachability for determining Internet connectivity in your iOS application.
FeatureFlags - Allows developers to configure feature flags, run multiple A/B or MVT tests using a bundled / remotely-hosted JSON configuration file.
FlexibleRowHeightGridLayout - A UICollectionView grid layout designed to support Dynamic Type by allowing the height of each row to size to fit content.
Hyperconnectivity - Modern replacement for Apple’s Reachability written in Swift and made elegant using Combine. An offshoot of the Connectivity framework.
Skylark - Fully Swift BDD testing framework for writing Cucumber scenarios using Gherkin syntax.
TailorSwift - A collection of useful Swift Core Library / Foundation framework extensions.
TypographyKit - Consistent & accessible visual styling on iOS with Dynamic Type support.
Updates - Automatically detects app updates and gently prompts users to update.
QSH is the interactive shell for playing quizzes through the macOS Terminal.
It is built on top of SwiftQuiz which provides the core functionality for making and playing quizzes in Swift. QSH provides the UI for accessing all of that functionality using the macOS Terminal.
⚠️ Work In Progress
This package is considered work in progress until reaching version 1.0.0.
Table of contents:
Quickstart
To play an example quiz:
Or:
Note: Accepts both HTTP and file URLs which must be proceeded by
file://
e.g.qsh --url file:///Users/username/Documents/example-playable-quiz.quiz
.To package an example quiz:
Note: Accepts both HTTP and file URLs which must be proceeded by
file://
e.g.qsh package-quiz --url file:///Users/username/Documents/quiz-input.json
.Features
Supported Features
Upcoming Features
Installation
Homebrew
To install via Homebrew run the following command from the Terminal:
Mint
To install using Mint run the following command:
Swift Package Manager
Build using Swift Package Manager as follows:
Then run using:
Usage
Packaging a Quiz
Note: To generate an AES-256 encryption key use a site such as this one.
Encrypted / Unencrypted Quiz Packages
QSH allows quizzes to be encrypted so that the answers contained within the quiz package cannot be readily be accessed preventing cheating. Use of this feature is optional as quiz packages may be encrypted or unencrypted. In order to encrypt a quiz during packaging, supply a AES-256 key generated using a site such as the one here using the
--key
parameter. If the--key
parameter is omitted then an unencrypted quiz package will be generated.Picture Rounds
To include a picture round as part of a quiz, include the parameter
image
as part of a short answer, multiple choice or multiple answer question. The value of theimage
parameter should be the URL (either a file URL or HTTP URL) of the image file. When the quiz is packaged, the image data will be included as part of the quiz package so that the images do not need to be downloaded separately at runtime.Automatic Marking
In order to enable automatic marking for a quiz, add the following to your quiz JSON file:
Take a look here for an example.
Alternatively, if you want to mark the old-fashioned way by swapping answers then simply set the
marking-occurs
property tonever
:Play a Quiz
Note: The
key
parameter is only required for encrypted packages.Help
Or to get help on a specific subcommand:
Developing a Quiz Client
The core functionality for packaging and playing quizzes is implemented by the Swift Quiz package with QSH providing the UI for the macOS Terminal. Should you wish to build your own client for playing quizzes e.g. using Linux, in theory you could do so using Swift Quiz.
Author
Ross Butler
Additional Software
Controls
Frameworks
Tools
cdd
from the Terminal.