選択肢の順番が固定→変更を目指します。
export const problemArrayData = [
{
id: 1,
correctAnswer: "b",
problemText:
explanationSentence: "当然、琵琶湖が日本一大きい湖である",
},
上記を下記へ変更します。
export const problemArrayData = [
{
id: 1,
correctAnswer: "琵琶湖",
problemText:
"日本で一番大きな湖は?",
explanationSentence: "当然、琵琶湖が日本一大きい湖である",
},
必要になってくるのは、
①文字列の連結
②配列要素の順番をランダムに入れ替える
③文字列比較