!7 module AskMeAQuestion > DynModule { S question, answer; visualize { ret makeForm2( "Computer question", dm_fieldLabel('question), "Human answer", centerAndEast(onEnter(dm_fieldTextField('answer), rThread submit), jbutton("Submit", rThread submit)), "", rightAlignedButtons("Ask me something else", rThread newQuestion)); } S randomWord() { randomEnglishWordFromDictionary(); } void newQuestion enter { setFields(answer := "", question := "Is " + randomWord() + " the same as " + randomWord() + "?"); } void submit enter { programLogStructure(litorderedmap(+question, +answer)); vmBus_send('userAnsweredQuestion, module(), question, answer); newQuestion(); } }