
<script src="../common/ui_utils.js"></script>

<script>
core.EPISODE_MAX_TIME = 2000000;  // 2000 seconds

var BUTTONS = ['Cancel', 'OK', 'x'];

var resetUI = function(div){
  if(div.html().length > 0) $('#dialog').dialog('destroy');
  div.empty(); // clear previous problem, if any
}

var genProblem = function() {

  var task_state = -1.0;
  // generate the task
  var div = $('#dialog');
  resetUI(div);
  var html = '<p>' + ui_utils.generateWords(4,8) + '</p>';
  div.append(html);
  var expectedButton = co