"WARNING", JOptionPane.WARNING_MESSAGE);
LOGGER.warn("Quesiton Not Selected");
} else
{
EntityManager em = emf.createEntityManager();
Question quest = (Question) lstQuestions.getSelectedValue();
// TODO: RAGE-24 - Migrate to the QuestionDAO class
Question question = em.find(Question.class, quest.getId());
JOptionPane.showMessageDialog(null, "You must select a Reference "
+ "Program and Destination File before reloading this question to"
+ " the database", "Warning", JOptionPane.WARNING_MESSAGE);
List<TestCase> testCaseList = question.getTestCases();
modTCList.removeAll();
//Reset the total value of the testcases to zero before calculating
//the new value.
questionValue = questionValue.multiply(questionValue.ZERO);
for (int i = 0; i < testCaseList.size(); i++)
{
modTCList.addTestCase(testCaseList.get(i));
questionValue = questionValue.add(testCaseList.get(i).getValue());
}
//Check the question to see if we are expecting an ordered output
// If we are, turn on the Ordered Output Checkbox
if (question.getOrderedOutput() == true)
{
chkOrdered.setSelected(true);
}
//Check the question to see if we are expecting verbatim output
//If so, turn on the Verbatium checkbox
if (question.getVerbatim() == true)
{
chkVerbatim.setSelected(true);
}
//Set the description field with the description of the question
txtDescription.setText(question.getDescription());
//Use a tempory category object to grab the name of the category as
// a string and set the category text box to that catgory name
Category tempCategory = question.getCategory();
txtCategory.setText(tempCategory.getName());
txtValue.setText(questionValue.toPlainString());
em.close();
}