Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docs/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,40 @@ components:
items:
type: string
description: "List of options for multiple_choice questions"
example:
- "Democratic"
- "Republican"
- "Libertarian"
- "Green"
- "Other"
all_options_ever:
type: array
items:
type: string
description: "List of all options ever for multiple_choice questions"
example:
- "Democratic"
- "Republican"
- "Libertarian"
- "Green"
- "Blue"
- "Other"
options_history:
type: array
description: "List of [iso format time, options] pairs for multiple_choice questions"
items:
type: array
items:
oneOf:
- type: string
description: "ISO 8601 timestamp when the options became active"
- type: array
items:
type: string
description: "Options list active from this timestamp onward"
example:
- ["0001-01-01T00:00:00", ["a", "b", "c", "other"]]
- ["2026-10-22T16:00:00", ["a", "b", "c", "d", "other"]]
status:
type: string
enum: [ upcoming, open, closed, resolved ]
Expand Down Expand Up @@ -1352,6 +1386,7 @@ paths:
actual_close_time: "2020-11-01T00:00:00Z"
type: "numeric"
options: null
options_history: null
status: "resolved"
resolution: "77289125.94957079"
resolution_criteria: "Resolution Criteria Copy"
Expand Down Expand Up @@ -1525,6 +1560,7 @@ paths:
actual_close_time: "2015-12-15T03:34:00Z"
type: "binary"
options: null
options_history: null
status: "resolved"
possibilities:
type: "binary"
Expand Down Expand Up @@ -1594,6 +1630,16 @@ paths:
- "Libertarian"
- "Green"
- "Other"
all_options_ever:
- "Democratic"
- "Republican"
- "Libertarian"
- "Green"
- "Blue"
- "Other"
options_history:
- ["0001-01-01T00:00:00", ["Democratic", "Republican", "Libertarian", "Other"]]
- ["2026-10-22T16:00:00", ["Democratic", "Republican", "Libertarian", "Green", "Other"]]
status: "open"
possibilities: { }
resolution: null
Expand Down
17 changes: 13 additions & 4 deletions front_end/messages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,7 @@
"settingsChangeEmailAddress": "Změnit e-mailovou adresu",
"settingsChangeEmailAddressSuccess": "Na váš nový e-mail byla zaslána potvrzovací zpráva. Prosím, následujte odkaz uvnitř pro aktivaci.",
"choices": "Možnosti",
"choicesLockedHelp": "Možnosti lze po zahájení prognózování měnit pouze v administrátorském panelu.",
"inCommunityReviewStatus1": "Tato otázka potřebuje schválení od kurátora komunity jako jste vy. Můžete také provádět úpravy, označit autora v komentáři níže, poslat otázku zpět k návrhu na revizi nebo otázku zamítnout. Několik návrhů na kvalitní otázky:",
"inCommunityReviewStatus2": "<li>Definujte pojmy a buďte konkrétní. Odkazy jsou užitečné.</li> <li>Otázky by se měly dát jednoduše vyřešit a neměly by vyžadovat velké úsilí administrátora.</li> <li>Název a formulace otázky by měly být v souladu s kritérii pro vyřešení.</li> <li>Zkuste tento test: Lidé v budoucnosti se shodnou, jak byla tato otázka vyřešena. Pokud nemohou, je třeba ji objasnit</li>",
"bulkEdit": "Hromadná úprava",
Expand Down Expand Up @@ -1833,9 +1834,20 @@
"tournamentsInfoTitle": "Jsme <predmarket>nepredikční trh</predmarket>. Můžete se účastnit zdarma a vyhrát peněžní ceny za přesnost.",
"tournamentsInfoScoringLink": "Co jsou předpovídací skóre?",
"tournamentsInfoPrizesLink": "Jak jsou rozdělovány ceny?",
"dismiss": "Zavřít",
"gracePeriodTooltip": "Pokud neaktualizujete své předpovědi před koncem této lhůty, vaše stávající předpovědi budou automaticky staženy.",
"newOptionsAddedPlural": "Tyto možnosti byly nedávno přidány, prosím upravte své předpovědi odpovídajícím způsobem.",
"newOptionsAddedSingular": "Nedávno byla přidána nová možnost, prosím upravte své předpovědi odpovídajícím způsobem.",
"showNewOptions": "Zobrazit nové možnosti",
"showNewOption": "Zobrazit novou možnost",
"timeRemaining": "Zbývající čas",
"periodDays": "{count, plural, one {# den} few {# dny} other {# dni}}",
"periodHours": "{count, plural, one {# hodina} few {# hodiny} other {# hodin}}",
"periodMinutes": "{count, plural, one {# minuta} few {# minuty} other {# minut}}",
"periodSeconds": "{count, plural, one {# sekunda} few {# sekundy} other {# sekund}}",
"othersCount": "Ostatní ({count})",
"featured": "Doporučené",
"staffPicks": "Výběr personálu",
"othersCount": "Ostatní ({count})",
"hero1TopTitle": "Platforma Metaculus",
"heroIndividualsTitle": "Rozhodujte se na základě důvěryhodných komunitních předpovědí",
"exploreQuestions": "Prozkoumat otázky",
Expand Down Expand Up @@ -1874,9 +1886,6 @@
"tournamentsForAIBots": "Turnaje pro AI roboty",
"futureEval": "Budoucí posouzení",
"launchATournament": "Spusťte turnaj",
"tournamentsInfoTitle": "Nejsme <predmarket>trh s prognózami</predmarket>. Můžete se účastnit zdarma a vyhrát peněžní ceny za přesné předpovědi.",
"tournamentsInfoScoringLink": "Co jsou prognostické skóre?",
"tournamentsInfoPrizesLink": "Jak jsou rozdělovány ceny?",
"allCategoriesTopQuestions": "Nejlepší otázky v každé kategorii",
"thousandsOfOpenQuestions": "20 000+ otevřených otázek"
}
13 changes: 12 additions & 1 deletion front_end/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@
"withdraw": "Withdraw",
"withdrawForecast": "Withdraw Forecast",
"withdrawAll": "Withdraw All",
"dismiss": "Dismiss",
"gracePeriodTooltip": "If you don't update your forecasts before the grace period ends, your existing forecasts will be automatically withdrawn.",
"newOptionsAddedPlural": "These options were recently added, please adjust your forecast(s) accordingly.",
"newOptionsAddedSingular": "A new option was recently added, please adjust your forecasts accordingly.",
"showNewOptions": "Show New Options",
"showNewOption": "Show New Option",
"timeRemaining": "Time remaining",
"periodDays": "{count, plural, one {# day} other {# days}}",
"periodHours": "{count, plural, one {# hour} other {# hours}}",
"periodMinutes": "{count, plural, one {# minute} other {# minutes}}",
"periodSeconds": "{count, plural, one {# second} other {# seconds}}",
"saveChange": "Save Change",
"reaffirm": "Reaffirm",
"reaffirmAll": "Reaffirm All",
Expand Down Expand Up @@ -100,7 +111,6 @@
"Upcoming": "Upcoming",
"Open": "Open",
"Closed": "Closed",
"Resolved": "Resolved",
"count": "Count",
"image": "Image",
"resolutionAmbiguous": "Ambiguous",
Expand Down Expand Up @@ -942,6 +952,7 @@
"resolutionCriteriaExplanation": "A good question will almost always resolve unambiguously. If you have a data source by which the question will resolve, link to it here. If there is some simple math that will need to be done to resolve this question, define the equation in markdown: <markdown>\\[ y = ax^2+b \\]</markdown>.",
"choices": "Choices",
"choicesSeparatedBy": "Choices (separated by ,)",
"choicesLockedHelp": "Options can only be changed through the admin panel once forecasting has started.",
"projects": "projects",
"FABPrizePool": "PRIZE POOL",
"FABPrizeValue": "$30,000",
Expand Down
17 changes: 13 additions & 4 deletions front_end/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1833,9 +1833,16 @@
"tournamentsInfoTitle": "Nosotros <predmarket>no somos un mercado de predicciones</predmarket>. Puedes participar gratis y ganar premios en efectivo por ser preciso.",
"tournamentsInfoScoringLink": "¿Qué son las puntuaciones de predicción?",
"tournamentsInfoPrizesLink": "¿Cómo se distribuyen los premios?",
"dismiss": "Descartar",
"gracePeriodTooltip": "Si no actualiza sus pronósticos antes de que termine el período de gracia, sus pronósticos existentes se retirarán automáticamente.",
"newOptionsAddedPlural": "Estas opciones se añadieron recientemente, por favor ajuste su(s) pronóstico(s) en consecuencia.",
"newOptionsAddedSingular": "Se añadió una nueva opción recientemente, por favor ajuste sus pronósticos en consecuencia.",
"showNewOptions": "Mostrar nuevas opciones",
"showNewOption": "Mostrar nueva opción",
"timeRemaining": "Tiempo restante",
"othersCount": "Otros ({count})",
"featured": "Destacado",
"staffPicks": "Selecciones del personal",
"othersCount": "Otros ({count})",
"hero1TopTitle": "Plataforma Metaculus",
"heroIndividualsTitle": "Toma decisiones basadas en pronósticos comunitarios confiables",
"exploreQuestions": "Explorar preguntas",
Expand Down Expand Up @@ -1874,9 +1881,11 @@
"tournamentsForAIBots": "Torneos para bots de IA",
"futureEval": "EvaluaciónFutura",
"launchATournament": "Iniciar un Torneo",
"tournamentsInfoTitle": "Nosotros <predmarket>no somos un mercado de predicciones</predmarket>. Puedes participar gratis y ganar premios en efectivo por ser preciso.",
"tournamentsInfoScoringLink": "¿Qué son las puntuaciones de pronóstico?",
"tournamentsInfoPrizesLink": "¿Cómo se distribuyen los premios?",
"allCategoriesTopQuestions": "Principales preguntas en cada categoría",
"periodDays": "{count, plural, one {# día} other {# días}}",
"periodHours": "{count, plural, one {# hora} other {# horas}}",
"periodMinutes": "{count, plural, one {# minuto} other {# minutos}}",
"periodSeconds": "{count, plural, one {# segundo} other {# segundos}}",
"choicesLockedHelp": "Las opciones solo se pueden cambiar a través del panel de administración una vez que haya comenzado la previsión.",
"thousandsOfOpenQuestions": "20,000+ preguntas abiertas"
}
17 changes: 13 additions & 4 deletions front_end/messages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1831,9 +1831,16 @@
"tournamentsInfoTitle": "Nós <predmarket>não somos um mercado de previsões</predmarket>. Você pode participar gratuitamente e ganhar prêmios em dinheiro por ser preciso.",
"tournamentsInfoScoringLink": "O que são pontuações de previsão?",
"tournamentsInfoPrizesLink": "Como os prêmios são distribuídos?",
"dismiss": "Dispensar",
"gracePeriodTooltip": "Se você não atualizar suas previsões antes do término do período de carência, suas previsões existentes serão retiradas automaticamente.",
"newOptionsAddedPlural": "Essas opções foram adicionadas recentemente, por favor ajuste suas previsões de acordo.",
"newOptionsAddedSingular": "Uma nova opção foi adicionada recentemente, por favor ajuste suas previsões de acordo.",
"showNewOptions": "Mostrar Novas Opções",
"showNewOption": "Mostrar Nova Opção",
"timeRemaining": "Tempo restante",
"othersCount": "Outros ({count})",
"featured": "Em destaque",
"staffPicks": "Escolhas da Equipe",
"othersCount": "Outros ({count})",
"hero1TopTitle": "Plataforma Metaculus",
"heroIndividualsTitle": "Tome decisões com base em previsões comunitárias confiáveis",
"exploreQuestions": "Explorar perguntas",
Expand Down Expand Up @@ -1872,9 +1879,11 @@
"tournamentsForAIBots": "Torneios para Bots de IA",
"futureEval": "FutureEval",
"launchATournament": "Lançar um Torneio",
"tournamentsInfoTitle": "Não somos um <predmarket>mercado de previsões</predmarket>. Você pode participar gratuitamente e ganhar prêmios em dinheiro por ser preciso.",
"tournamentsInfoScoringLink": "O que são pontuações de previsão?",
"tournamentsInfoPrizesLink": "Como os prêmios são distribuídos?",
"allCategoriesTopQuestions": "Principais perguntas em cada categoria",
"periodDays": "{count, plural, one {# dia} other {# dias}}",
"periodHours": "{count, plural, one {# hora} other {# horas}}",
"periodMinutes": "{count, plural, one {# minuto} other {# minutos}}",
"periodSeconds": "{count, plural, one {# segundo} other {# segundos}}",
"choicesLockedHelp": "As opções só podem ser alteradas através do painel de administração uma vez iniciado o processo de previsão.",
"thousandsOfOpenQuestions": "20.000+ perguntas abertas"
}
15 changes: 12 additions & 3 deletions front_end/messages/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -1827,9 +1827,13 @@
"tournamentTimelineClosed": "等待裁定",
"questionsPreviouslyPredicted": "先前預測的{count, plural, =1 {# 個問題} other {# 個問題}}",
"includeMyForecastAtTheTime": "包括我當時的預測 <strong>({forecast})</strong>",
"tournamentsInfoTitle": "我們 <predmarket>不是預測市場</predmarket>。您可以免費參加並因精確的預測贏取現金獎勵。",
"tournamentsInfoScoringLink": "什麼是預測得分?",
"tournamentsInfoPrizesLink": "獎品如何分配?",
"dismiss": "關閉",
"gracePeriodTooltip": "如果您在寬限期間結束之前未更新您的預測,您的現有預測將自動撤回。",
"newOptionsAddedPlural": "這些選項最近新增,請相應調整您的預測。",
"newOptionsAddedSingular": "一個新選項最近新增,請相應調整您的預測。",
"showNewOptions": "顯示新選項",
"showNewOption": "顯示新選項",
"timeRemaining": "剩餘時間",
"featured": "精選",
"staffPicks": "員工推薦",
"withdrawAfterPercentSetting2": "問題總生命周期後撤回",
Expand Down Expand Up @@ -1875,5 +1879,10 @@
"tournamentsInfoScoringLink": "什麼是預測得分?",
"tournamentsInfoPrizesLink": "獎品如何分配?",
"allCategoriesTopQuestions": "每個類別中的熱門問題",
"periodDays": "{count, plural, one {# 天} other {# 天}}",
"periodHours": "{count, plural, one {# 小時} other {# 小時}}",
"periodMinutes": "{count, plural, one {# 分鐘} other {# 分鐘}}",
"periodSeconds": "{count, plural, one {# 秒} other {# 秒}}",
"choicesLockedHelp": "一旦預測開始後,選項只能透過管理平台進行更改。",
"thousandsOfOpenQuestions": "20,000+ 開放問題"
}
17 changes: 13 additions & 4 deletions front_end/messages/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1835,9 +1835,16 @@
"tournamentsInfoTitle": "我们<predmarket>不是一个预测市场</predmarket>。您可以免费参与,并因精准的预测赢得现金奖品。",
"tournamentsInfoScoringLink": "什么是预测分数?",
"tournamentsInfoPrizesLink": "奖品如何分配?",
"dismiss": "忽略",
"gracePeriodTooltip": "如果您在宽限期结束前没有更新您的预测,现有的预测将自动撤回。",
"newOptionsAddedPlural": "这些选项是最近添加的,请相应调整您的预测。",
"newOptionsAddedSingular": "最近添加了一个新选项,请相应调整您的预测。",
"showNewOptions": "显示新选项",
"showNewOption": "显示新选项",
"timeRemaining": "剩余时间",
"othersCount": "其他({count})",
"featured": "精选",
"staffPicks": "员工精选",
"othersCount": "其他({count})",
"hero1TopTitle": "Metaculus 平台",
"heroIndividualsTitle": "根据可信赖的社区预测做出决策",
"exploreQuestions": "探索问题",
Expand Down Expand Up @@ -1876,9 +1883,11 @@
"tournamentsForAIBots": "AI机器人比赛",
"futureEval": "未来评估",
"launchATournament": "发起比赛",
"tournamentsInfoTitle": "我们<predmarket>不是预测市场</predmarket>。您可以免费参与,并因准确预测而赢取现金奖励。",
"tournamentsInfoScoringLink": "什么是预测得分?",
"tournamentsInfoPrizesLink": "奖金如何分配?",
"allCategoriesTopQuestions": "每个类别的热门问题",
"periodDays": "{count, plural, one {# 天} other {# 天}}",
"periodHours": "{count, plural, one {# 小时} other {# 小时}}",
"periodMinutes": "{count, plural, one {# 分钟} other {# 分钟}}",
"periodSeconds": "{count, plural, one {# 秒} other {# 秒}}",
"choicesLockedHelp": "选项一旦预测开始,只能通过管理面板进行更改。",
"thousandsOfOpenQuestions": "20,000+ 开放问题"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import { SearchParams } from "@/types/navigation";
import { Post, PostWithForecasts } from "@/types/post";
import { QuestionType, QuestionWithForecasts } from "@/types/question";
import { logError } from "@/utils/core/errors";
import { parseQuestionId } from "@/utils/questions/helpers";
import {
getAllOptionsHistory,
parseQuestionId,
} from "@/utils/questions/helpers";

import { AggregationWrapper } from "./aggregation_wrapper";
import { AggregationExtraMethod } from "../types";
Expand Down Expand Up @@ -417,8 +420,9 @@ function parseSubQuestions(
},
];
} else if (data.question?.type === QuestionType.MultipleChoice) {
const allOptions = getAllOptionsHistory(data.question);
return (
data.question.options?.map((option) => ({
allOptions?.map((option) => ({
value: option,
label: option,
})) || []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const ChoicesLegend: FC<Props> = ({
const t = useTranslations();
const { getThemeColor } = useAppTheme();
const mcMode = typeof othersToggle === "boolean" && !!onOthersToggle;

const { legendChoices, dropdownChoices } = useMemo(() => {
const left = choices.slice(0, maxLegendChoices);
const right = choices.slice(maxLegendChoices);
Expand All @@ -61,10 +60,10 @@ const ChoicesLegend: FC<Props> = ({

return (
<div className="relative flex flex-wrap items-center justify-center gap-[14px] text-xs font-normal">
{legendChoices.map(({ choice, color, active }, idx) => (
{legendChoices.map(({ label, choice, color, active }, idx) => (
<ChoiceCheckbox
key={`multiple-choice-legend-${choice}-${idx}`}
label={choice}
label={label || choice}
color={color.DEFAULT}
checked={active}
onChange={(checked) => onChoiceChange(choice, checked)}
Expand Down Expand Up @@ -122,19 +121,21 @@ const ChoicesLegend: FC<Props> = ({
label={areAllSelected ? t("deselectAll") : t("selectAll")}
className="p-1.5 capitalize"
/>
{dropdownChoices.map(({ choice, color, active }, idx) => (
<ChoiceCheckbox
key={`multiple-choice-dropdown-${choice}-${idx}`}
label={choice}
color={getThemeColor(color)}
checked={active}
onChange={(checked) => onChoiceChange(choice, checked)}
onHighlight={(highlighted) =>
onChoiceHighlight(choice, highlighted)
}
className="p-1.5"
/>
))}
{dropdownChoices.map(
({ label, choice, color, active }, idx) => (
<ChoiceCheckbox
key={`multiple-choice-dropdown-${choice}-${idx}`}
label={label || choice}
color={getThemeColor(color)}
checked={active}
onChange={(checked) => onChoiceChange(choice, checked)}
onHighlight={(highlighted) =>
onChoiceHighlight(choice, highlighted)
}
className="p-1.5"
/>
)
)}
</PopoverPanel>
</>
)}
Expand Down
Loading