In recent months, the altitude of Swiss cities has again been very important in determining whether snow will fall or not. Most places were too low.
In the coming months, altitude will again become more important when it comes to cooling down a bit. In short: it is always good to know how high you are above sea level. Prove you have the perspective in our estimation quiz:
const questionList = [ ['Lago Maggiore',193,'Tiefster Punkt der Schweiz','https://www.watson.ch/imgdb/b13c/Qx,E,0,0,0,0,0,0,0,0/2055384281160471', ''], ['Dufourspitze',4634,'Höchster Punkt der Schweiz','https://www.watson.ch/imgdb/292a/Qx,E,0,0,0,0,0,0,0,0/6591771185382525', ''], ['Juf GR',2126,'Höchstes, ganzjährig bewohntes Dorf Europas','https://www.watson.ch/imgdb/5349/Qx,E,0,0,0,0,0,0,0,0/2242807524551186', ''], ['Jungfraujoch',3454,'Höchste Bahnstation Europas','https://www.watson.ch/imgdb/ed06/Qx,E,0,0,0,0,0,0,0,0/3807603755623185', ''], ['Zürich',408,'','https://www.watson.ch/imgdb/8be3/Qx,E,0,0,0,0,0,0,0,0/3641480626225254', ''], ['Genf',375,'','https://www.watson.ch/imgdb/69ba/Qx,E,0,0,0,0,0,0,0,0/5205421835032970', ''], ['Bern',540,'','https://www.watson.ch/imgdb/56b6/Qx,E,0,0,0,0,0,0,0,0/3097972812262044', ''], ['St.Gallen',669,'','https://www.watson.ch/imgdb/438f/Qx,E,0,0,0,0,0,0,0,0/3592969154536259', ''], ['Davos GR',1560,'','https://www.watson.ch/imgdb/079e/Qx,E,0,0,0,0,0,0,0,0/8783524759448294', ''], ['Andermatt UR',1437,'','https://www.watson.ch/imgdb/903e/Qx,E,0,0,0,0,0,0,0,0/8447810209919624', ''], ['La Chaux-de-Fonds NE',992,'','https://www.watson.ch/imgdb/cc48/Qx,E,0,0,0,0,0,0,0,0/8758339263745607', ''], ['Arosa GR',1775,'','https://www.watson.ch/imgdb/6f85/Qx,E,0,0,0,0,0,0,0,0/4699458341992569', ''], ['Verbier VS',1490,'','https://www.watson.ch/imgdb/16fd/Qx,E,0,0,0,0,0,0,0,0/5498254987961663', ''], ['Appenzell',777,'','https://www.watson.ch/imgdb/5ece/Qx,E,0,0,0,0,0,0,0,0/2053923644729806', ''], ['Delémont JU',435,'','https://www.watson.ch/imgdb/665a/Qx,E,0,0,0,0,0,0,0,0/2424564786907984', ''], ['Airolo TI',1175,'','https://www.watson.ch/imgdb/cf1b/Qx,E,0,0,0,0,0,0,0,0/2093799113607432', ''], ['Saas-Fee VS',1800,'','https://www.watson.ch/imgdb/b506/Qx,E,0,0,0,0,0,0,0,0/7617095673382092', ''], ['St. Moritz GR',1822,'','https://www.watson.ch/imgdb/49a0/Qx,E,0,0,0,0,0,0,0,0/5093017797539245', '']]; const projectId = 32; // Add in this list: https://docs.google.com/spreadsheets/d/1jJDX-UIVlUcK0OET2zjrmfqeqcRe3WUF38Q3FSiBHns/edit?usp=sharing const unit=" M.ü.M."; // What unit are the values in? const min = 100; // Minimum value const max = 5000; // Maximum value
const lessLabel = min.toString() + unit; // Labelling of the min value const moreLabel = max.toString() + unit; // Labelling of the max value
// make a function createQuestionContent that returns the content of the question function createQuestionContent(reviewQuestions) {
for (var idx = 0; idx < questionList.length; idx++) { var questionContent = "
" + questionList[idx][0] + "
" + questionList[idx][2] +
"
" + questionList[idx][4] + "
Deine Schätzung: " + min + " " + unit +
"
Schnitt watson-User: – " + unit +
"
Tatsächliche Höhenlage: – " + unit + "
“; questionContent += “
“; reviewQuestions[idx].innerHTML = question content; } // Update value in text element var allSliders = document.getElementsByClassName(‘questionSlider’); Array.prototype.forEach.call(allSliders, function (slider) { // Loop over each element to .oninput function slider.oninput = function (event) { var idx = slider.getAttribute(‘idx’); // now update according to span document.getElementById(‘r’ + idx + ‘-my’).innerHTML = formatText(this.value);} }); return reviewQuestions; } const roundedStartMean = Math.round((min + max) / 2); for (var idx = 0; idx < poll.length; idx++) { poll[idx].push(roundedStartAverage); } image URLs = []; average URLs = []; for (var idx = 0; idx < questionList.length; idx++) {
var id = questionList[idx][3].split("https://www.watson.ch/").pop();
var picutreUrl = "https://www.watson.ch/api/2.0/images/" + id;
pictureUrls.push(picutreUrl);
var key = "slider-quiz" + projectId.toString() + "-" + (idx + 1).toString();
var apiUrlWatsonMean = "https://www.watson.ch/api/2.0/key-values/" + key + "/histogram";
averageUrls.push(apiUrlWatsonMean);
}
Promise.all(
pictureUrls.map(url =>
fetch(url).then(response => response.json()) .catch(error => console.error(error)) ) ).then(data => { // loop over data for (var idx = 0; idx < data.length; idx++) {
var pictureCredit = "Bild: " + data[idx].data.credit;
questionList[idx][4] = pictureCredit;
}
reviewQuestions = createQuestionContent(reviewQuestions)
})
.catch(error => console.error(error)); Promise.all( averageUrls.map(url => fetch(url) .then(response => response.json()) .catch(error => console.error(error)) ) ) .then(data => { / / loop over data for (var idx = 0; idx < data.length; idx++) { const keys = Object.keys(data[idx].facts); const values = Object.values(data[idx].facts); if (keys.length != 0) { // transform keys to numbers for (let i = 0; i < keys.length; i++) { keys[i] = parseInt(keys[i]); } let the sum = 0; for (let i = 0; i < keys.length; i++) {
sum += keys[i] * values[i];
}
average = sum / values.reduce((acc, curr) => acc + current, 0); average = Math.round(average); questionList[idx][5] = mean; reviewQuestions = createQuestionContent(reviewQuestions) } } }).catch(error => console.error(error)); var reviewQuestions = document.getElementsByClassName(‘reviewQuestion’); if (reviewQuestions.length != questionList.length) { console.log(“questionList must be the same length as the number of divs (list: ” + questionList.length + “, divs: ” + reviewQuestions.length + “)!”) } function formatText(text) { if (text % 1 === 0) { return text.toString(); } else { return text.toFixed(2).toString(); } } reviewQuestions = createQuestionContent(reviewQuestions) function sendData(questionId, noReview = false) { let dataToSend = { ‘questionId’: questionId, ‘version’: 0.9, ‘projectId’: projectId }; if (noReview) { // just get the average dataToSend[‘userInput’] = zero; document.querySelector(“#r” + questionId + “-my”).innerHTML = “-“; document.querySelector(“#s” + questionId + “-slider”).classList.add(‘rangeOut’); } else { // send my review let valSlider = document.querySelector(“#s” + questionId + “-slider”).value; dataToSend[‘userInput’] = parseFloat(valSlider); const key = “slider quiz” + projectId.toString() + “-” + (questionId + 1).toString(); const jwt_token = localStorage.getItem(“jwt_token”); const jwt_free_token = localStorage.getItem(“jwt_free_token”); const user_id = localStorage.getItem(“user_id”); let value as (user_id) { value = { user: user_id, value: dataToSend[‘userInput’]
}; } else { value = { user: jwt_free_token, value: dataToSend[‘userInput’]
}; } let options = { method: ‘post’, body: JSON.stringify(dataToSend) }; fetch(`https://www.watson.ch/api/2.0/key-values/${key}`, { method: “POST”, headers: { “Content-Type”: “application/json”, ” Authorization”: `Bearer ${jwt_free_token}` }, body: JSON.stringify(value) }) .then(response => response.json()).catch(error => console.error(error)); } document.querySelector(“#r” + questionId + “-wtsn”).innerHTML = formatText(questionList[
questionId][5]); document.querySelector(“#r” + questionId + “-co2”).innerHTML = formatText(questionList[
questionId][1]); document.querySelector(“#wtsnMean-” + questionId).style.display = ‘inline’; document.querySelector(“#wtsnMean-” + questionId).style.left = (0.88 * ((questionList[questionId][5] – min) * 100 / (max – min)) + 5) + “%”; document.querySelector(“#wtsnMean-” + questionId).style.display = ‘inline’; document.querySelector(“#co2-” + questionId).style.left = (0.88 * ((questionList[questionId][1] – min) * 100 / (max – min)) + 5) + “%” document.querySelector(“#co2-” + questionId).style.display = ‘inline’; document.querySelector(“#btnRate-” + questionId).disabled = true; document.querySelector(“#btnView-” + questionId).disabled = true; document.querySelector(“#s” + questionId + “-slider”).disabled = true; }
Source: Blick

I am Ross William, a passionate and experienced news writer with more than four years of experience in the writing industry. I have been working as an author for 24 Instant News Reporters covering the Trending section. With a keen eye for detail, I am able to find stories that capture people’s interest and help them stay informed.