title: Using ipywidget for multiple choice test
body: <p>I'm pretty new to python and python notebooks.  Im trying to create a Jupyter notebook that will display an image from a list of images and give the user 4 choices to what that image in the from of clickable ipywidget buttons. Once the user clicks their choice, I want to replace the image with a new image and repopulate the buttons with 4 new choices. </p>
  
  <p>I know how to clear the image output and close the button widgets using button.close(), but I can't seem to figure out how to redraw the buttons with new choices. Once I've closed the container, I cant figure out how to loop back to the top since I'm stuck in the on_button_clicked function once a choice is made.   Here's what I have so far, though I know its no where near working yet and it probably way off in the approach.  Note I don't need to use ipywidgets, but it seemed like a good choice in the sense of clickable buttons: </p>
  
  <pre><code>x = ['tree.jpg','house.jpg','car.jpg','door.jpg','train.jpg','moon.jpg']
  
  choices = random.sample(x, 4)
  correct = random.choice(choices)
  
  display(Image(correct))
  time.sleep(3)
  
  button1 = widgets.Button(description = x[0])
  button2 = widgets.Button(description = x[1])
  button3 = widgets.Button(description = x[2])
  button4 = widgets.Button(description = x[3])
  
  container = widgets.HBox(children=[button1,button2,button3,button4])
  display(container)
  
  
  button1.on_click(on_button1_clicked)
  button2.on_click(on_button2_clicked)
  button3.on_click(on_button3_clicked)
  button4.on_click(on_button4_clicked)
  
  
  def on_button1_clicked(b):
       # [insert code to record choice] 
      container.close()
      clear_output()
  
  def on_button2_clicked(b):
       # [insert code to record choice] 
      container.close()
      clear_output()
  
  def on_button3_clicked(b):
       # [insert code to record choice] 
      container.close()
      clear_output()
  
  def on_button4_clicked(b):
       # [insert code to record choice] 
      container.close()
      clear_output()
  </code></pre>
  
  <p>thanks alot!</p>