Meetings

Language Handling

The free version of the WordPress Polylang plugin does not include the language support in the REST API. With the assistance of ChatGPT-4o I added the following php-code at the end of the theme functions.php file :

add_action( 'rest_api_init', function () {
    register_rest_field( 'post',
        'translations',
        array(
            'get_callback' => function( $post_arr ) {
                return function_exists( 'pll_get_post_translations' )
                    ? pll_get_post_translations( $post_arr['id'] )
                    : null;
            },
            'schema' => null,
        )
    );
});

Here is the resulting JSON response when fetching a WordPress post in english, with translations in fr, de, pt and lb.

{"id":12,
"date":"2025-05-24T14:28:53",
"date_gmt":"2025-05-24T14:28:53",
"guid":{"rendered":"https:\/\/admin.ki-leierbud.lu\/?p=12"},
"modified":"2025-05-27T14:14:38",
"modified_gmt":"2025-05-27T14:14:38",
"slug":"ki-leierbud-what",
"status":"publish",
"type":"post",
"link":"https:\/\/admin.ki-leierbud.lu\/archives\/12",
"title":{"rendered":"KI-L\u00e9ierbud. What?"},
"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/admin.ki-leierbud.lu\/wp-content\/uploads\/what.png\" alt=\"\" class=\"wp-image-23\" srcset=\"https:\/\/admin.ki-leierbud.lu\/wp-content\/uploads\/what.png 1024w, https:\/\/admin.ki-leierbud.lu\/wp-content\/uploads\/what-300x300.png 300w, https:\/\/admin.ki-leierbud.lu\/wp-content\/uploads\/what-150x150.png 150w, https:\/\/admin.ki-leierbud.lu\/wp-content\/uploads\/what-768x768.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>KI-L\u00e9ierbud is an interactive web portal aimed at the general public, with the goal of making artificial intelligence (AI) accessible and understandable.<br>This site will offer educational content, interactive demonstrations, mini-courses, quizzes, and simulators to explain the fundamentals, applications, and ethical issues related to AI.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>KI-L\u00e9ierbud is an interactive web portal aimed at the general public, with the goal of making artificial intelligence (AI) accessible and understandable.This site will offer educational content, interactive demonstrations, mini-courses, quizzes, and simulators to explain the fundamentals, applications, and ethical issues related to AI.<\/p>\n",
"protected":false},
"author":1,
"featured_media":0,
"comment_status":"closed",
"ping_status":"closed",
"sticky":false,
"template":"",
"format":"standard",
"meta":{"footnotes":""},
"categories":[203],
"tags":[],
"class_list":["post-12",
"post","type-post",
"status-publish",
"format-standard"
"hentry","category-leierbud"],
"translations":{"en":12,"fr":71,"de":73,"lb":76,"pt":114},
"_links":{"self":[{"href":"https:\/\/admin.ki-leierbud.lu\/wp-json\/wp\/v2\/posts\/12",
"targetHints":{"allow":["GET"]}}],
"collection":[{"href":"https:\/\/admin.ki-leierbud.lu\/wp-json\/wp\/v2\/posts"}],
"about":[{"href":"https:\/\/admin.ki-leierbud.lu\/wp-json\/wp\/v2\/types\/post"}],
"author":[{"embeddable":true,"href":"https:\/\/admin.ki-leierbud.lu\/wp-json\/wp\/v2\/users\/1"}],
"replies":[{"embeddable":true,
"href":"https:\/\/admin.ki-leierbud.lu\/wp-json\/wp\/v2\/comments?post=12"}],
"version-history":[{"count":4,
"href":"https:\/\/admin.ki-leierbud.lu\/wp-json\/wp\/v2\/posts\/12\/revisions"}],
"predecessor-version":[{"id":437,
"href":"https:\/\/admin.ki-leierbud.lu\/wp-json\/wp\/v2\/posts\/12\/revisions\/437"}],
"wp:attachment":[{"href":"https:\/\/admin.ki-leierbud.lu\/wp-json\/wp\/v2\/media?parent=12"}],
"wp:term":[{"taxonomy":"category",
"embeddable":true,
"href":"https:\/\/admin.ki-leierbud.lu\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag",
"embeddable":true,
"href":"https:\/\/admin.ki-leierbud.lu\/wp-json\/wp\/v2\/tags?post=12"}],
"curies":[{"name":"wp",
"href":"https:\/\/api.w.org\/{rel}",
"templated":true}]}}

Ask your AI helper : difficulty levels of a quiz

Question to ChatGPT-4o :

how to describe the difficulty of a quiz ?

Answer of ChatGPT-4o :


To describe the difficulty levels of a quiz clearly and progressively, you can use a graded scale with commonly understood labels. Here’s a well-structured set of terms, from easiest to hardest:

Standard Quiz Difficulty Levels

  1. Very Easy
  2. Easy
  3. Moderate
  4. Difficult
  5. Very Difficult

Optional Alternatives (if you want to vary tone or context):

For a friendlier, more casual app:

  • Beginner
  • Basic
  • Intermediate
  • Challenging
  • Expert

For a gamified or playful experience:

  • Warm-up
  • Casual
  • Thinker
  • Tough Nut
  • Mastermind

You can also add icons or color cues to make it more intuitive:

  • 🔹 Very Easy (green or 1 star)
  • 🔸 Moderate (yellow or 3 stars)
  • 🔺 Very Difficult (red or 5 stars)

Weak

🧩 Score ≤ 5%Don’t give up!

“It didn’t click this time, but that’s okay! Use this as a starting point. Learning is a journey, and you’ve just begun.”

Poor

🌱 Score > 5% and ≤ 25%Still learning

“This quiz was a challenge – but every expert starts somewhere. Go over the material and give it another shot!”

Fair

🤔 Score > 25% and ≤ 50%Keep going!

“Some parts went well, others need a bit more focus. Review and try again – you’re getting there!”

Good

🙂 Score > 50% and ≤ 75%Good effort!

“You’re on the right track! With a bit more practice, you’ll master this in no time.”

Strong

Score > 75% and ≤ 95%Great job!

“Well done! You clearly understand the content. Just a few small tweaks and you’re at the top!”

Excellent

🔥 Score > 95%Outstanding!

“Incredible work! You nailed it – your attention to detail is remarkable. Keep up this top-level performance!”