data.push("12: Choo-Choo needs magnesium for the production of Zen. Because a new source of magnesium was just found, prices for it have fallen. Choo-Choo would pay 50,000 Euro less for this ingredient than expected."); data.push("13: Choo-Choo could avoid competition for Zen if it gets a patent for the new formula. But it would cost an additional 100,000 Euro in legal fees on top of the forecast."); data.push("14: Market research has shown that Zen would make 100% of the predicted sales if it was the only gum of this kind on the market. But there is a competitor planning to launch the very same kind of gum at the same time. This would cut the sales to 50%."); data.push("15: The financial department has calculated that Zen would make 0.75 Euro profit per item. They expect to sell 400,000 items."); data.push("16: The R&D department has proposed a standard, well-tested formula for Treasure Island."); data.push("17: As Choo-Choo only produces gum, they have to buy the prize toys elsewhere. They have found a supplier who can sell them max. 1,000 toys at 50 Euro per toy."); data.push("18: According to law, Choo-Choo must guarantee that every child who sends in a completed Treasure Island map indeed gets the exact same toy that is shown in the promotion. Breaking this law would cause severe bad press and might ruin the company."); data.push("19: Market research shows that kids love the map collecting. Treasure Island would sell 100% as expected. As the kids will use online social networks to exchange map pieces, it is sure that between 1,500 and 2,000 maps will be completed and sent in for a prize toy."); data.push("20: The financial department has calculated that Treasure Island would make 1.25 Euro profit per item and expects sales of 400,000 items. This calculation does not include the cost of the prize toys though."); data.push("21: The R&D department has come up with a very innovative formula for Whitey. It uses soft granules in the gum for a mechanical whitening effect and does not contain any chemical whiteners."); data.push("22: Whitening chemicals that are usually contained in whitening gums can cause damage to the machines. Taking care of it would cost an additional 50,000 Euro."); data.push("23: The government has set up a new initiative to support innovation. But only innovations that are actually brought into production can get it. Whitey's formula is very innovative. If it is put on the market, Choo-Choo would get an innovation award and a prize of 100,000 Euro."); data.push("24: According to market research, Whitey would make 100% of the predicted sales."); data.push("25: The financial department has calculated that Whitey would make 0.50 Euro profit per item. They expect to sell 400,000 items."); data.push("26: The R&D department has developed a formula with an extra-long freshness effect for Business Class. It works, but they have not done extensive testing series because that would cost 100,000 Euro extra."); data.push("27: Choo-Choo can use existing production facilities for Business Class, which makes it very simple."); data.push("28: According to law, if Choo-Choo wants to promote Business Class by saying that it has an extra-long freshness effect, they first have to show results of an extensive testing series. Otherwise, they cannot use this claim for promoting sales."); data.push("29: Market research shows that the extra-long freshness effect of Business Class brings sales up to 150% of the expectation. But for this, the gums have to be sold with this claim; otherwise, it will not sell at all."); data.push("30: The financial department has calculated that Business Class would make 0.50 Euro profit per item. They expect sales of 400,000 items."); function chatReceived(from,val) { var color = "blue"; if (from == myid) { color = "green"; $('#chat_conversation').append('
You:
'+val+'
'); chats.push(val); } else if (from ==99){ //if it's the bot, append it with the botname $('#chat_conversation').append('
'+botname+':
'+val+'
'); } else { $('#chat_conversation').append('
'+getName(from)+':
'+val+'
'); chats.push(val); } $('#chat_conversation').scrollTop = $('#chat_conversation').scrollHeight; } function appendToChatConversation(message, sender = 'User') { console.log('resp2 '+ message) let formattedMessage = `
${sender}: ${message}
`; $('#chat_conversation').append(formattedMessage); } function greetFromGpt(message){ console.log('resp2 '+ message) let greetMessage = `
${botname}: ${greeting}
`; $('#chat_conversation').append(greetMessage); } async function openai_chat_completions_create(message, temperature=.7, model='gpt-3.5-turbo-0125'){ const openAIResponse = await fetch("https://volunteerscience.com/openai/chat/", { method: "POST", body: JSON.stringify({ message: message, temperature: temperature, model: model }), headers: { "Content-type": "application/json; charset=UTF-8" } }); const result = await openAIResponse.json(); return result; } function receiveMessage(event) { if (event.data === 'stage 1-u1 ready') { console.log('Stage 1-u1 is ready. Proceeding to group discussion...'); } if (event.data == "closeQSIWindow") { document.getElementById("qualFrame").style.display = 'none'; experimentComplete(); } if (event.data == "popupConsent") { if (REQUEST_CONSENT) { requestConsent(); } } if (event.data == "payAMT") { if (IS_AMT){ payAMT(true, AMTBonus); } } } function initialize() { initializeChat(); greetFromGpt(); startGPT(); document.getElementById("survey_title").innerHTML = variables["title"]; window.addEventListener("message", receiveMessage, false); document.getElementById("qualFrame").setAttribute("src", variables["survey_link"] + "&testId=" + seed + "&subjectId=" + myid); document.getElementById("qualFrame").style.height = variables["survey_height"]; document.getElementById("qualFrame").style.display = 'block'; }