oTree icon indicating copy to clipboard operation
oTree copied to clipboard

DEMO_PAGE_INTRO_HTML not shown on oTree hub

Open peterjc opened this issue 4 years ago • 5 comments

Steps to reproduce at time of writing:

  1. Goto https://www.otreehub.com/projects/mdt-intr-exp-met/
  2. Text includes the line "To edit your app's description, go to settings.py and edit DEMO_PAGE_INTRO_HTML."
  3. Click "Browse source code"
  4. Click "settings.py"
  5. Notice that DEMO_PAGE_INTRO_HTML is set:
...
DEMO_PAGE_INTRO_HTML = 'Risk attitude lottery game based on Holt and Laury (2002), followed by an interactive multi-player game about volunteering. <a href="https://github.com/peterjc/MDT-INTR-EXP-MET">Source code on GitHub</a>.'

The text is shown correctly on the demo page:

  1. Goto https://mdt-intr-exp-met.herokuapp.com/demo
  2. Notice following description in right hand side box "Risk attitude lottery game based on Holt and Laury (2002), followed by an interactive multi-player game about volunteering. Source code on GitHub." (with link)

peterjc avatar Sep 24 '21 09:09 peterjc

Based on #107, were using DEMO_PAGE_INTRO_HTML with triple-quoted string broke, I suspect there is an ad hoc parser involved. This may not support all the Python string syntax?

peterjc avatar Sep 24 '21 10:09 peterjc

All the working examples from a quick browse on oTree Hub use a triple-quoted multi-line string, like this:

DEMO_PAGE_INTRO_HTML = """
Experiment.
"""

peterjc avatar Sep 24 '21 10:09 peterjc

Thank you for the report. Yes it's not 100% accurate but my goal is just to capture most of those strings.

oTree-org avatar Sep 25 '21 08:09 oTree-org

So if I really want my example's description to show, just use a multi-line triple quoted string as a workaround?

peterjc avatar Sep 25 '21 10:09 peterjc

Confirming successful workaround using a triple-quoted multi-line string, however surprisingly even with an introduction string the message about how to change it is still shown.

peterjc avatar Dec 10 '21 12:12 peterjc