#371
The Quiz Upgrader
 

Difficulty:Medium
Topics:Real life cases List of Maps


Mission: "The Question Upgrader" menghadapi tantangan untuk upgrade database soal yang sudah outdated. Setiap soal dalam format lama diwakili oleh map dengan :question-text, :choices (list of strings untuk pilihan jawaban), dan :correct (string yang menunjukkan jawaban yang benar). Misi lo adalah untuk transform soal-soal tersebut ke format baru yang lebih enrich, dengan menambahkan penjelasan :explanation untuk jawaban yang benar pada setiap soal. Penjelasan bisa sederhana, seperti "Because it is the correct answer."
test not run
(= (__ [{:question-text "H2O known as?" :choices ["Water", "Hydrogen Peroxide", "Salt"] :correct "Water"}])
   [{:question-text "H2O known as?" :choices {"A" "Water", "B" "Hydrogen Peroxide", "C" "Salt"} :correct "A" :explanation "Because it is the correct answer."}])
test not run
(= (__ [{:question-text "Speed of light?" :choices ["3.0x10^8 m/s", "5.0x10^8 m/s"] :correct "3.0x10^8 m/s"}])
   [{:question-text "Speed of light?" :choices {"A" "3.0x10^8 m/s", "B" "5.0x10^8 m/s"} :correct "A" :explanation "Because it is the correct answer."}])
test not run
(= (__ []) [])
test not run
(= (__ [{:question-text "The tallest mountain?" :choices ["Everest", "K2"] :correct "Everest"}])
   [{:question-text "The tallest mountain?" :choices {"A" "Everest", "B" "K2"} :correct "A" :explanation "Because it is the correct answer."}])


Code which fills in the blank: