This is not under MIT license. It is intended for testing and might contain proprietary code.


In [3]:
import exercises
from qa_display_widgets import FillGapsBox

exerc = exercises.SolveForXLinear(2)
FillGapsBox(exerc).box()



In [1]:
import main
main.SolveForXLinear(3).display()

In [1]:
import ipywidgets as widgets
import traitlets
from IPython.display import display

In [2]:
import main
import sympy
from IPython.display import Math
sympy.init_printing()

In [8]:
from ipywidgets import Layout, Button, Box

items_layout = Layout(flex='1 1 auto',
                      width='auto')     # override the default width of the button to 'auto' to let the button grow

box_layout = Layout(display='flex',
                    flex_flow='column', 
                    align_items='stretch', 
                    border='solid',
                    width='50%')

words = ['correct', 'horse', 'battery', 'staple']
items = [Button(description=w, layout=items_layout, button_style='danger') for w in words]
box = Box(children=items, layout=box_layout)
box

In [2]:
from ipywidgets import Layout, Button, Box

items_layout = Layout(width='auto')     # override the default width of the button to 'auto' to let the button grow

box_layout = Layout(display='flex',
                    flex_flow='column', 
                    align_items='stretch', 
                    border='solid',
                    width='50%')

words = ['correct', 'horse', 'battery', 'staple']
items = [Button(description=w, layout=items_layout, button_style='danger') for w in words]
box = Box(children=items, layout=box_layout)
box



In [15]:
b1 = Button(description='My button')
b1.style.background = '/home/blue/PycharmProjects/ipy_student_exercises/own_images/simple_grey_button.png'
b1



In [4]:
from IPython.display import HTML 
HTML(""" <style>
.widget-button {
  background-image: ;
  background-position: 50% 50%;
  background-size: cover;
}
</style> """)


Out[4]:

In [50]:
from ipywidgets import Layout, Button, Box

items = [
    Button(description='1'),
    Button(description='2', layout=Layout(flex='0.1 1 auto')),
    Button(description='1'),
 ]

box_layout = Layout(display='flex',
                    flex_flow='row', 
                    align_items='stretch', 
                    border='solid',
                    width='100%')
box = Box(children=items, layout=box_layout)
box