Django Quiz - Language & Styling

Language

...

<head>
    ...
    <script src="https://unpkg.com/survey-core@2.5.8/survey.i18n.min.js"></script>

</head>

<body>
    ...
    <script>

        Survey.surveyLocalization.defaultLocale = "pt";

    </script>

</body>

This defines the language used for:

  • buttons (Next, Previous, Complete)
  • validation messages
  • system texts

 

 

Logo

...
<body>

    ...
    <script>

        ...
        //Place after the definition of survey
        survey.logo = "/static/images/logo.png";
        survey.logoPosition = "right";
        ...

    </script>

</body>

 

Available positions:

  • "left"
  • "right"

 

Basic color theme

Themes: https://surveyjs.io/form-library/documentation/manage-default-themes-and-styles

...

<head>
    ...
    <!-- <script src="https://unpkg.com/survey-core@2.5.8/themes/sharp-dark.min.js"></script>  -->
    <!-- <script src="https://unpkg.com/survey-core@2.5.8/themes/sharp-dark-panelless.min.js"></script> -->
    <script src="https://unpkg.com/survey-core@2.5.8/themes/sharp-light.min.js"></script>

</head>

<body>
    ...
    <script>
        
        ...
        //survey.applyTheme(SurveyTheme.SharpDark);
        //survey.applyTheme(SurveyTheme.SharpDarkPaneless);
        survey.applyTheme(SurveyTheme.SharpLight);


    </script>

</body>

There's a lot of combos to explore between Dark/Light and Panelless. Here are some of the root options:

  • Default
  • Sharp
  • Borderless
  • Flat
  • Plain
  • Double Border
  • Layered
  • Solid
  • 3D
  • Contrast

Keep in mind that despite not mentioning in the post, you can customize it with CSS in detail.