MCPcopy Index your code
hub / github.com/figma/plugin-samples / reorderOptions

Function reorderOptions

trivia/code.ts:201–207  ·  view source on GitHub ↗
(correctAnswer: string, incorrectAnswers: string[])

Source from the content-addressed store, hash-verified

199}
200
201function reorderOptions(correctAnswer: string, incorrectAnswers: string[]) {
202 const options = [...incorrectAnswers, correctAnswer]
203
204 // Reorder the questions
205 options.sort(() => Math.random() > 0.5 ? 1 : -1)
206 return options
207}
208
209function createText(characters: string, size: number) {
210 const text = figma.createText()

Callers 1

displaySingleQuestionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected