To add a quiz, run pushkin install experiment. Select the experiment template of choice (see this list for the options). This will create a pushkin experiment template in the experiments/ folder.
Open the config.js located in your experiment folder, and modify the experiment name, shortName, logo, text, etc.
experimentName:&fullName'mind Experiment'shortName:&shortName'mind' # Thisshouldbeuniqueasitsusedforurls,etc.apiControllers: # ThedefaultexportfromeachoftheselocationswillbeattachedtoapushkinAPI-mountPath:*shortNamelocation:'api controllers'name:'mycontroller'worker:location:'worker'service: # whattoaddasaserviceinmaincomposefileimage:*shortNamelinks:-message-queue-test_dbenvironment:-"AMQP_ADDRESS=amqp://message-queue:5672"-"DB_USER=postgres"-"DB_PASS="-"DB_URL=test_db"-"DB_NAME=test_db"webPage:location:'web page'migrations:location:'migrations'seeds:location:''# UsedformigrationandseedcommandsviamainCLI# Notethatthesemightbedifferentthanthosegiventotheworker,# Sinceit's running inside a linked docker containerdatabase:'localtestdb'logo:'Mind.png'text:'Enter your experiment description here'tagline:'Be a citizen scientist! Try this quiz.'duration:''
After running pushkin prep, the experiments.js located in pushkin/front-end/src will be updated, it should be an array of objects like this:
Then the new quiz card will be automatically added to the home page.
Jumbotron
The Jumbotron is a lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.
It includes a link to the feedback page and an anchor tag wrapped in <LinkContainer> component.
CardDeck
The <CardDeck> creates a grid of cards that are of equal height and width. The layout will automatically adjust as you insert more cards. We recommend putting every 3 cards in a card deck. Quizzes are wrapped in card decks in Home.js located in pushkin/front-end/src/pages.
Card
Bootstrap’s cards provides a flexible and extensible content container with multiple variants and options:
Body: Use <Card.Body> to pad content inside a <Card>.
Title, text, and links: Using <Card.Title>, <Card.Subtitle>, and <Card.Text> inside the <Card.Body> will line them up nicely. <Card.Link> are used to line up links next to each other.
Images: Cards include a few options for working with images. Choose from appending “image caps” at either end of a card, overlaying images with card content, or simply embedding the image in a card.
Image clickable area styling: If you would like to use circular images and limit the clickable space to be circular, be sure to keep the :hoverStyles.circleStyle className in the <LinkContainer. If you would like to use square or rectangular images, be sure to not include this className.
For example, the quiz card in the home page:
The components inside a quiz card, in order from top to bottom, are:
<Card.Img>: Quiz cover image
<Card.Title>: Quiz name
<Card.Text>: Quiz description
<Button>: Wrapped in <LinkContainer>
<SocialIcon>: The react social icons provides a set of beautiful svg social icons.
<Jumbotron style={{backgroundColor:'#eeeeee'}}>
<div>
We do <strong>citizen science</strong> to learn how the mind
works.{' '}
</div>
<div>
<strong>
Pick a game to get started!
</strong>
</div>
<div className="mt-3">
Feel free to send us feedback <LinkContainer to="/feedback"><a><strong>HERE</strong></a></LinkContainer>
</div>
</Jumbotron>