Post #5: Everything almost done

ymartinez
Published: 08/10/2021

Hi everyone! This is my 5th blog post, and it is the last before the coding phase ends. I can't believe that almost 2 months have passed, the whole experience has been awesome, however, I am going deeper into it in the next post.

Last week I was working on modifying the graphical user interface. This change was necessary to improve the lesson's context, with this information the future students of the course can know more about the interfaces and the basic differences between them. In addition, I changed the initial position of dialogs to the left upper corner, this change helps to a better experience when creating the dialogs. I made a PR with this change and it is awaiting the mentors' review. Below there is a result of this change.

Code


from browser import document, html
from browser.widgets.dialog import Dialog

# Creación de un dialogo con el título
d = Dialog("Show de preguntas Zombis", top=20, left=20)

# Agrega elementos como botones y títulos
d.panel <= html.H3(
    "Aprieta los botones",
    id="titulo_ventana",
    style=dict(textAlign="center")
)
d.panel <= html.BUTTON("Correcto", id="btn_correcto")

d.panel <= html.BUTTON("Incorrecto",
    id="btn_incorrecto",
    style=dict(marginLeft="5em")
)

<svg width="20px" height="20px" viewBox="0 0 24 24" class="highlight-action crayons-icon highlight-action--fullscreen-on"><title>Enter fullscreen mode</title> <path d="M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z"></path> </svg> <svg width="20px" height="20px" viewBox="0 0 24 24" class="highlight-action crayons-icon highlight-action--fullscreen-off"><title>Exit fullscreen mode</title> <path d="M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z"></path> </svg>

Result
Result Dialog

I made a few Proof of Concepts with different approaches until I found the best solution for my problem, however, one of the approaches that I used was inherited from the Brython class dialog and overwrote the methods that I needed. This approach was the optimal solution but I had a problem, the Brython interpreter did not allow me to do it and I had several issues with this, then I changed it to a simple solution, which can not be optimal, but remember...

Better done than perfect

DJDT

Versions

Time

Settings from gsoc.settings

Headers

Request

SQL queries from 1 connection

Static files (2312 found, 3 used)

Templates (11 rendered)

Cache calls from 1 backend

Signals

Log messages