#372
The Progen transformer
 

Difficulty:Easy
Topics:Real life cases List of Maps


Mission: "The Choice Architect" meminta bantuan lo untuk mendesain ulang sistem penilaian dengan memodifikasi format soal pilihan ganda yang sudah usang. Diberikan list of maps yang masing-masing mengandung :question, :options (list of strings), dan :answer (string jawaban yang benar), transformasikan soal-soal ini ke format baru dengan opsi sebagai vector of maps yang memiliki :option-text dan :correct?. Randomisasi urutan opsi bukan bagian dari soal ini, tapi ingat untuk menandai opsi yang benar.
test not run
(= (__ [{:question "What is the capital of France?" :options ["Paris", "London", "Berlin"] :answer "Paris"}])
   [{:question "What is the capital of France?"
     :options [{:option-text "Paris" :correct? true}
               {:option-text "London" :correct? false}
               {:option-text "Berlin" :correct? false}]}])
test not run
(= (__ [{:question "Who discovered penicillin?" :options ["Marie Curie", "Alexander Fleming", "Louis Pasteur"] :answer "Alexander Fleming"}])
   [{:question "Who discovered penicillin?"
     :options [{:option-text "Marie Curie" :correct? false}
               {:option-text "Alexander Fleming" :correct? true}
               {:option-text "Louis Pasteur" :correct? false}]}])
test not run
(= (__ []) [])
test not run
(= (__ [{:question "Which gas is most abundant in the Earth's atmosphere?" :options ["Oxygen", "Hydrogen", "Nitrogen"] :answer "Nitrogen"}])
   [{:question "Which gas is most abundant in the Earth's atmosphere?"
     :options [{:option-text "Oxygen" :correct? false}
               {:option-text "Hydrogen" :correct? false}
               {:option-text "Nitrogen" :correct? true}]}])


Code which fills in the blank: