Esempio n. 1
0
 private void fillUpChoices(CreateQuestionParameters createQuestionParameters) {
   if (createQuestionParameters.questionHasAnswerChoices()) {
     setAnswerChoices(createQuestionParameters);
   } else if (createQuestionParameters.questionHasSmartAnswerChoices()) {
     setSmartAnswerChoices(createQuestionParameters);
   }
 }
Esempio n. 2
0
 private void fillUpNumericDetails(CreateQuestionParameters createQuestionParameters) {
   if (createQuestionParameters.isNumericQuestionType()) {
     selenium.type(
         "currentQuestion.numericMin", createQuestionParameters.getNumericMin().toString());
     selenium.type(
         "currentQuestion.numericMax", createQuestionParameters.getNumericMax().toString());
   }
 }
Esempio n. 3
0
 protected void enterDetails(CreateQuestionParameters createQuestionParameters) {
   selenium.type("currentQuestion.text", createQuestionParameters.getText());
   selenium.select(
       "id=currentQuestion.type",
       "value=" + translateQuestionType(createQuestionParameters.getType()));
   fillUpChoices(createQuestionParameters);
   fillUpNumericDetails(createQuestionParameters);
 }
Esempio n. 4
0
 private void setAnswerChoices(CreateQuestionParameters createQuestionParameters) {
   for (String choice : createQuestionParameters.getChoicesAsStrings()) {
     selenium.type("currentQuestion.currentChoice", choice);
     selenium.keyUp("id=currentQuestion.currentChoice", " ");
     selenium.click("_eventId_addChoice");
     waitForPageToLoad();
   }
 }
Esempio n. 5
0
 private void setSmartAnswerChoices(CreateQuestionParameters createQuestionParameters) {
   List<Choice> choices = createQuestionParameters.getChoices();
   for (int i = 0, choicesSize = choices.size(); i < choicesSize; i++) {
     Choice choice = choices.get(i);
     selenium.type("currentQuestion.currentSmartChoice", choice.getChoiceText());
     selenium.keyUp("id=currentQuestion.currentSmartChoice", " ");
     selenium.click("_eventId_addSmartChoice");
     waitForPageToLoad();
     for (String tag : choice.getTags()) {
       String tagId = "currentQuestion.currentSmartChoiceTags[" + i + "]";
       selenium.type(tagId, tag);
       selenium.keyUp("id=" + tagId, " ");
       selenium.click("addSmartChoiceTag_" + i);
       waitForPageToLoad();
     }
   }
 }