Skip to content

Commit

Permalink
Merge pull request #44 from nzzdev/release-1.5.1
Browse files Browse the repository at this point in the history
Release 1.5.1
  • Loading branch information
fuenkchen authored Jan 12, 2018
2 parents 3af63fc + 880025c commit 5098b2a
Show file tree
Hide file tree
Showing 22 changed files with 199 additions and 2,360 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ scripts
styles
.DS_STORE
dev.js
test/logs/pouchdb.log
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.2
9.3
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
- docker
language: node_js
node_js:
- '9.2'
- '9.3'
install:
- npm install -g jspm
- npm install
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use following version of Node as the base image
FROM node:9.2
FROM node:9.3

# Set work directory for run/cmd
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nzz/q-quiz",
"version": "1.5.0",
"version": "1.5.1",
"description": "Q quiz",
"keywords": [
"storytelling",
Expand Down
98 changes: 0 additions & 98 deletions resources/fixtures/data/cover-all-question-types-no-last-card.json

This file was deleted.

61 changes: 61 additions & 0 deletions resources/fixtures/data/cover-with-title-no-last-card.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"title": "FIXTURE: Ein Quiz mit Cover mit Titel, alle Fragetypen, ohne letzte Seite",
"elements": [
{
"id": "quiz-1-1503673199200-897399321",
"title": "Ein tolles Quiz",
"type": "cover"
},
{
"id": "quiz-1-1503673205043-233776299",
"type": "multipleChoice",
"image": {},
"choices": [
"vielleicht",
"falsch",
"absolut falsch"
],
"articleRecommendations": [],
"question": "Was ist die richtige Antwort?",
"answer": "richtig"
},
{
"id": "quiz-1-1503673244888-827300797",
"type": "numberGuess",
"image": {},
"articleRecommendations": [],
"question": "Hausnummer der NZZ",
"answer": 11,
"min": 1,
"max": 20,
"step": 1
},
{
"id": "quiz-1-1503673602641-999859280",
"type": "mapPointGuess",
"answer": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
8.548714,
47.3664
]
},
"properties": {
"pointLabel": "NZZ Red",
"label": "11 Falkenstrasse"
},
"bbox": [
8.50547790527344,
47.347779215247144,
8.591995239257814,
47.38498483918202
]
},
"image": {},
"articleRecommendations": [],
"question": "wo ist die nzz?"
}
]
}
32 changes: 32 additions & 0 deletions resources/fixtures/data/single-map-point-guess.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"title": "FIXTURE: Map point guess - single question quiz",
"elements": [
{
"id": "quiz-4-1503673602641-999859280",
"type": "mapPointGuess",
"answer": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
8.548714,
47.3664
]
},
"properties": {
"pointLabel": "NZZ Red",
"label": "11 Falkenstrasse"
},
"bbox": [
8.50547790527344,
47.347779215247144,
8.591995239257814,
47.38498483918202
]
},
"image": {},
"articleRecommendations": [],
"question": "wo ist die nzz?"
}
]
}
18 changes: 18 additions & 0 deletions resources/fixtures/data/single-multiple-choice.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"title": "FIXTURE: Multiple choice - single question quiz",
"elements": [
{
"id": "quiz-2-1503673205043-233776299",
"type": "multipleChoice",
"image": {},
"choices": [
"vielleicht",
"falsch",
"mal noch ein längere Antwort: Der Teamwettbewerb für Männer und Frauen im Ski Alpin, das Mixed-Doppel im Curling, der Massenstart im Eisschnelllaufen und der Big-Air-Wettbewerb im Snowboarden"
],
"articleRecommendations": [],
"question": "Was ist die richtige Antwort?",
"answer": "richtig"
}
]
}
16 changes: 16 additions & 0 deletions resources/fixtures/data/single-number-guess.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"title": "FIXTURE: Number guess - single question quiz",
"elements": [
{
"id": "quiz-3-1503673375520-572013568",
"type": "numberGuess",
"image": {},
"articleRecommendations": [],
"question": "Temperatur",
"answer": 25,
"min": 1,
"max": 35,
"step": 1
}
]
}
9 changes: 8 additions & 1 deletion routes/fixtures/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ const fixtureDataDirectory = '../../resources/fixtures/data';
// provide every fixture data file present in ../../resources/fixtures/data
const fixtureData = [
require(`${fixtureDataDirectory}/all.json`),
require(`${fixtureDataDirectory}/cover-all-question-types-no-last-card.json`)
require(`${fixtureDataDirectory}/cover-with-title-no-last-card.json`),
require(`${fixtureDataDirectory}/single-multiple-choice.json`),
require(`${fixtureDataDirectory}/single-number-guess.json`),
require(`${fixtureDataDirectory}/single-map-point-guess.json`),
// Todo:
// Quiz mit Bildern
// Quiz mit Artikelempfehlungen
// Quiz mit ausformulierten Antworten
];

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion script_src/NumberGuessHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class NumberGuessHandler {

renderInput() {
const labelContainer = this.inputElement.parentNode.firstChild;
let label = labelContainer.querySelector('.s-input-range-position-label');
let label = labelContainer.querySelector('.q-quiz-input-range-position-label');
this.inputElement.setAttribute('value', this.defaultInputValue);
this.defaultInputValue = this.inputElement.value;

Expand Down
33 changes: 8 additions & 25 deletions styles_src/default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,56 +83,44 @@
margin-bottom: 8px;
}

.s-input-range-container {
.q-quiz-input-range-container {
position: relative;
padding-top: 1em;
}

.s-input-range.disabled {
.q-quiz-input-range.disabled {
opacity: 0.2;
}

.s-input-range-container::after {
.q-quiz-input-range-container::after {
content: '';
display: table;
clear: left;
}

.s-input-range-min {
.q-quiz-input-range-min {
float: left;
padding-top: 8px;
}

.s-input-range-max {
.q-quiz-input-range-max {
float: right;
padding-top: 8px;
}

.s-input-range-position-label-container {
.q-quiz-input-range-position-label-container {
position: relative;
margin: 0 14px 9px 14px;
height: 1em;
}

.s-input-range-position-label {
.q-quiz-input-range-position-label {
position: absolute;
width: 200px;
text-align: center;
transform: translateX(-50%);
}

.q-quiz-answer-button {
width: 100%;
margin-top: 10px;
opacity: 1;

transition: opacity 0.1s ease-out;

&.state-clicked {
opacity: 0;
}
}

.q-quiz-element-container {
img {
display: block;
Expand All @@ -144,11 +132,11 @@
border-bottom: 1px solid currentColor;
margin-top: 32px;
padding: 14px;
text-align: center;

& .q-quiz-play-another-teaser,
& .q-quiz-play-another-title {
margin: 0 auto;
text-align: center;
}

& .q-quiz-play-another-title {
Expand All @@ -160,11 +148,6 @@
}
}

.q-quiz__last-card .q-quiz-button__icon {
margin-top: 12px;
}


@import "./numberGuess";
@import "./mapPointGuess";
@import "./multipleChoice";
Expand Down
Loading

0 comments on commit 5098b2a

Please sign in to comment.