Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1-navigation
  • 15-choses-a-faire-css
  • 2-gitlab-deploy
  • 3-qcu-features
  • 42-mementos-non-pris-en-compte-dans-commentaires-survey
  • add-tat-sample
  • gitlab-ci-debug
  • macao3-export
  • main
  • test
10 results

Target

Select target project
  • macao/macao-hugo
  • dbeniamine/macao-hugo
2 results
Select Git revision
  • 1-navigation
  • 15-choses-a-faire-css
  • 2-gitlab-deploy
  • 3-qcu-features
  • add-tat-sample
  • gitlab-ci-debug
  • macao3-export
  • main
  • test
9 results
Show changes

Commits on Source 103

3 additional commits have been omitted to prevent performance issues.
Showing
with 591 additions and 122 deletions
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="DBNavigator.Project.DDLFileAttachmentManager">
<mappings />
<preferences />
</component>
<component name="DBNavigator.Project.DatabaseAssistantManager">
<assistants />
</component>
<component name="DBNavigator.Project.DatabaseBrowserManager"> <component name="DBNavigator.Project.DatabaseBrowserManager">
<autoscroll-to-editor value="false" /> <autoscroll-to-editor value="false" />
<autoscroll-from-editor value="true" /> <autoscroll-from-editor value="true" />
...@@ -22,6 +29,7 @@ ...@@ -22,6 +29,7 @@
<display-mode value="TABBED" /> <display-mode value="TABBED" />
<navigation-history-size value="100" /> <navigation-history-size value="100" />
<show-object-details value="false" /> <show-object-details value="false" />
<enable-sticky-paths value="true" />
</general> </general>
<filters> <filters>
<object-type-filter> <object-type-filter>
...@@ -47,9 +55,15 @@ ...@@ -47,9 +55,15 @@
<object-type name="TYPE" enabled="true" /> <object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" /> <object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" /> <object-type name="ARGUMENT" enabled="true" />
<object-type name="JAVA_CLASS" enabled="true" />
<object-type name="JAVA_INNER_CLASS" enabled="true" />
<object-type name="JAVA_FIELD" enabled="true" />
<object-type name="JAVA_METHOD" enabled="true" />
<object-type name="DIMENSION" enabled="true" /> <object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" /> <object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" /> <object-type name="DBLINK" enabled="true" />
<object-type name="CREDENTIAL" enabled="true" />
<object-type name="AI_PROFILE" enabled="true" />
</object-type-filter> </object-type-filter>
</filters> </filters>
<sorting> <sorting>
...@@ -86,9 +100,15 @@ ...@@ -86,9 +100,15 @@
<object-type name="FUNCTION" enabled="true" /> <object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" /> <object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" /> <object-type name="TYPE" enabled="true" />
<object-type name="JAVA CLASS" enabled="true" />
<object-type name="INNER CLASS" enabled="true" />
<object-type name="JAVA FIELD" enabled="true" />
<object-type name="JAVA METHOD" enabled="true" />
<object-type name="JAVA PARAMETER" enabled="true" />
<object-type name="DIMENSION" enabled="false" /> <object-type name="DIMENSION" enabled="false" />
<object-type name="CLUSTER" enabled="false" /> <object-type name="CLUSTER" enabled="false" />
<object-type name="DBLINK" enabled="true" /> <object-type name="DBLINK" enabled="true" />
<object-type name="CREDENTIAL" enabled="false" />
</lookup-objects> </lookup-objects>
<force-database-load value="false" /> <force-database-load value="false" />
<prompt-connection-selection value="true" /> <prompt-connection-selection value="true" />
...@@ -363,9 +383,6 @@ ...@@ -363,9 +383,6 @@
<compile-dependencies value="ASK" /> <compile-dependencies value="ASK" />
<always-show-controls value="false" /> <always-show-controls value="false" />
</compiler> </compiler>
<debugger>
<debugger-type value="JDBC" />
</debugger>
</operation-settings> </operation-settings>
<ddl-file-settings> <ddl-file-settings>
<extensions> <extensions>
...@@ -379,6 +396,7 @@ ...@@ -379,6 +396,7 @@
<mapping file-type-id="TYPE" extensions="tpe" /> <mapping file-type-id="TYPE" extensions="tpe" />
<mapping file-type-id="TYPE_SPEC" extensions="tps" /> <mapping file-type-id="TYPE_SPEC" extensions="tps" />
<mapping file-type-id="TYPE_BODY" extensions="tpb" /> <mapping file-type-id="TYPE_BODY" extensions="tpb" />
<mapping file-type-id="JAVA_SOURCE" extensions="sql" />
</extensions> </extensions>
<general> <general>
<lookup-ddl-files value="true" /> <lookup-ddl-files value="true" />
...@@ -388,6 +406,11 @@ ...@@ -388,6 +406,11 @@
<make-scripts-rerunnable value="true" /> <make-scripts-rerunnable value="true" />
</general> </general>
</ddl-file-settings> </ddl-file-settings>
<assistant-settings>
<credential-settings>
<credentials />
</credential-settings>
</assistant-settings>
<general-settings> <general-settings>
<regional-settings> <regional-settings>
<date-format value="MEDIUM" /> <date-format value="MEDIUM" />
......
...@@ -3,8 +3,13 @@ ...@@ -3,8 +3,13 @@
Portage de l'application MACAO (Module d'Aide à la Compréhension de l'Anglais Oral), basé sur le générateur de site statique [Hugo](https://gohugo.io/) et la bibliothèque [SurveyJS](https://surveyjs.io/form-library/documentation/overview) Portage de l'application MACAO (Module d'Aide à la Compréhension de l'Anglais Oral), basé sur le générateur de site statique [Hugo](https://gohugo.io/) et la bibliothèque [SurveyJS](https://surveyjs.io/form-library/documentation/overview)
[![License: GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE) [![License: GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)
.
# Setup # Démo. avec Gitlab Pages
https://macao.pages.tetras-libre.fr/macao-hugo/
# Installation pour le développent
- [Installer Hugo](https://gohugo.io/installation/) **(version 0.124 minimum)** - [Installer Hugo](https://gohugo.io/installation/) **(version 0.124 minimum)**
- `git clone --recurse-submodules gitlab@gitlab.tetras-libre.fr:macao/macao-hugo.git` - `git clone --recurse-submodules gitlab@gitlab.tetras-libre.fr:macao/macao-hugo.git`
- `cd macao-hugo/macao` - `cd macao-hugo/macao`
...@@ -15,6 +20,6 @@ Pour build le site statique : `hugo` ...@@ -15,6 +20,6 @@ Pour build le site statique : `hugo`
Le contenu de `public/` peut être publié avec n'importe quel serveur HTTP statique. Le contenu de `public/` peut être publié avec n'importe quel serveur HTTP statique.
# Licences # Licences
Ce projet, à l'exception du répertoire `macao/content`, est distribué sous licence [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.html), dont les termes sont décrits dans le fichier [`LICENSE`](./LICENSE). Ce projet, à l'exception des répertoires `macao/content` et `static/media`, est distribué sous licence [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.html), dont les termes sont décrits dans le fichier [`LICENSE`](./LICENSE).
Le contenu du répertoire `content` utilise une licence séparée, décrite dans le fichier [`macao/content/LICENSE.md`](./macao/content/LICENSE.md) Le contenu des répertoires `macao/content` et `static/media` utilise une licence séparée, décrite dans le fichier [`macao/content/LICENSE.md`](./macao/content/LICENSE.md)
\ No newline at end of file \ No newline at end of file
body { body {
--accent-quiz: #2aa198; // Global theme colors are defined in macao/themes/macao-hugo-theme/assets/_defaults.scss and go to @mixin theme-tetras
// Defined but not used for now
--quizz-backgourd-color: #00000; --quizz-backgourd-color: #00000;
--feedback-sucess-color: lightgreen; --feedback-sucess-color: #FFF2CC;
--feedback-error-color: #ef5d5d; --feedback-error-color: #FFF2CC;
} }
// *********************************** // ***********************************
// Gloabl // Global
// *********************************** // ***********************************
* {
line-height: 1.2 !important
}
#sv-nav-complete { img.inlineImage {
display: none; vertical-align: middle;
height: 1em;
}
img.inlineImage12 {
vertical-align: middle;
height: 1.2em;
}
img.inlineImage14 {
vertical-align: middle;
height: 1.4em;
}
img.inlineImage16 {
vertical-align: middle;
height: 1.6em;
}
img.inlineImage18 {
vertical-align: middle;
height: 1.8em;
}
img.inlineImage2 {
vertical-align: middle;
height: 2em;
}
img.inlineImage22 {
vertical-align: middle;
height: 2.2em;
}
img.inlineImage24 {
vertical-align: middle;
height: 2.4em;
}
img.inlineImage26 {
vertical-align: middle;
height: 2.6em;
}
img.inlineImage28 {
vertical-align: middle;
height: 2.8em;
}
img.inlineImage3 {
vertical-align: middle;
height: 3em;
}
.btn-play {
cursor: pointer;
background-color: var(--macao-primary-color);
border-radius: 5px;
border: none;
padding: 5px 10px;
color: white;
}
.notextplay {
font-size: 0; /* hides text */
color: white;
}
.notextplay i {
font-size: medium; /* keep icon visible */
} }
p#gapfill-container { p#gapfill-container {
...@@ -39,7 +111,6 @@ select.sd-dropdown.inline-dropdown, input.sd-input.inline-input { ...@@ -39,7 +111,6 @@ select.sd-dropdown.inline-dropdown, input.sd-input.inline-input {
} }
#correct-indic { #correct-indic {
//border: 2px solid var(--accent-quiz);
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
...@@ -69,5 +140,141 @@ select.sd-dropdown.inline-dropdown, input.sd-input.inline-input { ...@@ -69,5 +140,141 @@ select.sd-dropdown.inline-dropdown, input.sd-input.inline-input {
.sd-question__header { .sd-question__header {
margin-top: 0; margin-top: 0;
max-width: 150px;
}
}
// ***********************************
// General look and feel
// ***********************************
.book-page > article {
background-color: var(--secondary-background-color);
border-radius: 15px;
}
.book-page > article {
padding: 16px;
margin-top: 16px;
}
.book-search {
border-radius: 10px;
padding: 0px 5px;
background-color: var(--secondary-background-color);
}
a {
color: var(--macao-primary-color);
}
a:visited {
color: var(--macao-primary-color) !important;
}
a.active {
color: var(--macao-secondary-font-color) !important;
background-color: var(--macao-primary-color);
border-radius: 5px;
padding: 5px;
margin-right: 5px;
}
// Hide element when width is less than 900px
@media (min-width: 900px) {
.book-icon {
display: none;
}
}
.sd-btn {
padding: 5px 10px !important;
}
// ***********************************
// Comment on page
// ***********************************
.comment-trigger {
cursor: pointer;
color: var(--macao-primary-color);
text-decoration: underline;
}
em:not(:has(strong)) {
background-color: lightgray;
padding: 3px;
padding-right: 4px;
border-radius: 5px;
}
// ***********************************
// Dropdowns
// ***********************************
// Min width for dropdowns
.sv-dropdown_select-wrapper {
min-width: 150px !important;
}
// ***********************************
// .sv-title-actions__title
// ***********************************
.sv-title-actions__title {
white-space: break-spaces !important;
}
.one-line {
.sd-question__header {
max-width: 60%;
}
.sv-string-viewer {
display: inline-flex;
align-items: center;
gap: 5px;
max-width: 100%;
flex-wrap: wrap;
}
}
/* Base style for buttons with the class "block" */
button.block {
background-color: white; /* White background */
border: 2px solid black; /* Black border */
color: black; /* Transparent text color to hide any text */
padding: 5px 10px; /* Padding around the button */
display: inline-block; /* Display as inline-block */
font-size: 14px; /* Font size */
margin: 2px; /* Margin around the button */
cursor: pointer; /* Pointer cursor on hover */
border-radius: 2; /* No rounded corners */
vertical-align: middle; /* Vertically align the button */
text-align: center; /* Center the text */
width: calc(10px + 50px * var(--duration)); /* Width proportional to the duration attribute */
height: 30px;
overflow: hidden; /* Hide overflow text */
white-space: nowrap; /* Prevent text from wrapping */
text-overflow: ellipsis; /* Add ellipsis if text overflows */
}
/* Additional style for buttons with both "block" and "outlined" classes */
button.block.outlined {
background-color: transparent; /* Transparent background */
border: 2px solid orange; /* Orange border */
} }
/* Set the --duration CSS variable based on the duration attribute */
button.block {
--duration: 0; /* Default duration */
} }
button.block[duration] {
--duration: attr(duration numeric, 0);
}
@import "plugins/_scrollbars.scss";
...@@ -2,5 +2,70 @@ console.log('Custom JS loaded'); ...@@ -2,5 +2,70 @@ console.log('Custom JS loaded');
$(document).ready(function() { $(document).ready(function() {
console.log('Custom JS executed'); console.log('Custom JS executed');
// Add specific classes to play buttons // Add specific classes to play buttons
$('button:contains("Play")').html('<i class="fa-solid fa-play"></i>'); $('button:contains("Play")').html('<i class="fa-solid fa-play"></i> Écouter').addClass('btn-play').prop('title','Écouter');
// Add Title on top of the page
$('.book-header').show();
$('.commentaireInfo').hide();
// $('.commentaireInfo').prop('popover', 'auto');
$('.commentaireInfoGroup').show();
// Comment popover
$('[spanid]').addClass('comment-trigger').each(function (){
const spanid = $(this).attr('spanid');
if($("[commentaireid=" + spanid + "]").length !== 0) {
$(this).popover({
trigger: 'click',
html: true,
placement: 'auto',
content: $("[commentaireid=" + spanid + "]")
});
$("[commentaireid=" + spanid + "]").toggle()
}
});
// $(document).on('click', function() {
// $('[spanid]').popover('hide');
// });
// Simplify th in td
$('th').each(function () {
// Store the current content of the <th>
const content = $(this).html();
// Replace <th> with a <td> containing the same content
$(this).replaceWith(`<td>${content}</td>`);
});
// Tricky way to add gap between play button and the next element
// like http://localhost:1313/macao-hugo/activities/mosorgmacao_fusion_ss_barre/mosmod10/mosmod11/mosetp129/pg334/
$(".btn-play").parent().siblings().css("margin-top", "10px")
if ($(window).width() > 900) {
$('.book-icon').hide();
}
});
document.addEventListener('DOMContentLoaded', function() {
// Select all buttons with the class 'block'
const buttons = document.querySelectorAll('button.block');
// Loop through each button and set the width and label
buttons.forEach(function(button) {
const duration = parseFloat(button.getAttribute('duration'));
if (!isNaN(duration)) {
// Set the width proportional to the duration
button.style.width = `calc(50px + 50px * ${duration})`;
}
const label = button.getAttribute('label');
if (label) {
// Set the button's text content to the label attribute
button.textContent = label;
} else {
// If no label attribute, clear the text content
button.textContent = '';
}
});
}); });
/** /**
* Checks whether all questions are correctly answered and displays the overall feedback. * Checks the answers for questions.
*/ */
function checkAllQuestions(questions, surveyConfig, converter) { function checkAnswers() {
const currentPage = survey.currentPage;
let allCorrect = true; let allCorrect = true;
questions.forEach((question) => { // Iterate over each element on the current page
if (!question.isAnswerCorrect()) { currentPage.elements.forEach((element) => {
if (element.getType() === 'html' && element.correctAnswers) {
// Handle fill-in-the-blank questions
element.correctAnswers.forEach((correctAnswerArray, index) => {
const blankId = `blank${currentPage.elements.indexOf(element) + 1}`;
const inputElement = document.getElementById(blankId);
let userAnswer;
if (inputElement.tagName === 'INPUT') {
userAnswer = inputElement.value.trim().toLowerCase();
} else if (inputElement.tagName === 'SELECT') {
userAnswer = inputElement.options[inputElement.selectedIndex].value.trim().toLowerCase();
}
// Check if the user's answer matches any of the correct answers
if (!correctAnswerArray.some(correctAnswer => userAnswer === correctAnswer.toLowerCase())) {
allCorrect = false; allCorrect = false;
} }
}); });
} else if (element.getType() === 'radiogroup' && element.correctAnswer !== undefined) {
// Handle radio group questions
const userAnswer = element.value;
if (userAnswer != element.correctAnswer) {
allCorrect = false;
}
}
});
// Update feedback based on whether all answers are correct
if (allCorrect) { if (allCorrect) {
correctIndic.node.className = "correct"; correctIndic.node.className = "correct";
correctIndic.commentNode.innerHTML = converter.renderInline(surveyConfig.correctComment) || "All answers are correct!"; correctIndic.commentNode.innerHTML = jsonStatic.correctComment || "C'est correct !";
} else { } else {
correctIndic.node.className = "incorrect"; correctIndic.node.className = "incorrect";
correctIndic.commentNode.innerHTML = converter.renderInline(surveyConfig.incorrectComment) || "Some answers are incorrect!"; correctIndic.commentNode.innerHTML = jsonStatic.incorrectComment || "Vous vous trompez.";
} }
} }
/** /**
* Clears all answers and resets the feedback indicator. * Clears all answers from the questions.
*/ */
function clearAllQuestions(questions) { function clearAnswers() {
questions.forEach((question) => { const currentPage = survey.currentPage;
question.value = undefined; currentPage.elements.forEach((element, elementIndex) => {
if (element.getType() === 'html' && element.correctAnswers) {
element.correctAnswers.forEach((_, index) => {
const blankId = `blank${elementIndex + 1}`;
const inputElement = document.getElementById(blankId);
if (inputElement.tagName === 'INPUT') {
inputElement.value = "";
} else if (inputElement.tagName === 'SELECT') {
inputElement.selectedIndex = 0;
}
});
} else if (element.getType() === 'radiogroup') {
// Clear radio group selection
element.clearValue();
}
}); });
correctIndic.node.className = "hidden"; correctIndic.node.className = "hidden";
correctIndic.commentNode.innerHTML = ""; correctIndic.commentNode.innerHTML = "";
} }
/**
* Renders the appropriate input method based on the presence of the "options" attribute.
*/
function renderInputMethod(element, elementIndex) {
const blankId = `blank${elementIndex + 1}`;
const inputElement = document.getElementById(blankId);
if (inputElement) {
// Create the appropriate input method based on the presence of options
if (element.options && element.options.length > 0) {
// Render a dropdown if options are available
const selectElement = document.createElement('select');
selectElement.id = blankId;
selectElement.className = 'fill-in-blank';
// Add a blank default option
const defaultOption = document.createElement('option');
defaultOption.value = "";
defaultOption.textContent = "";
selectElement.appendChild(defaultOption);
// Add the rest of the options
element.options.forEach(option => {
const optionElement = document.createElement('option');
optionElement.value = option;
optionElement.textContent = option;
selectElement.appendChild(optionElement);
});
// Replace the input element with the select element
inputElement.replaceWith(selectElement);
} else {
// Ensure it's an input element if no options are available
const inputTextElement = document.createElement('input');
inputTextElement.type = 'text';
inputTextElement.id = blankId;
inputTextElement.className = 'fill-in-blank';
inputTextElement.placeholder = ''; // Set an empty placeholder
// Replace any non-input element with the input element
inputElement.replaceWith(inputTextElement);
}
}
}
let correctIndic; let correctIndic;
let survey;
let converter;
$(function () { $(function () {
correctIndic = { correctIndic = {
...@@ -40,25 +124,71 @@ $(function () { ...@@ -40,25 +124,71 @@ $(function () {
}; };
Survey.JsonObject.metaData.addProperty("question", { Survey.JsonObject.metaData.addProperty("question", {
name: "customFormat", type: "text", category: "general", default: "", visibleIndex: 0, name: "customFormat",
type: "text",
category: "general",
default: "",
visibleIndex: 0,
});
Survey.JsonObject.metaData.addProperty("survey", {
name: "isSurveySummaryVisible",
type: "boolean",
category: "general",
default: "false",
visibleIndex: 0,
});
Survey.JsonObject.metaData.addProperty("question", {
name: "helpComment",
type: "text",
category: "general",
default: "",
visibleIndex: 0,
});
Survey.JsonObject.metaData.addProperty("question", {
name: "compComment",
type: "text",
category: "general",
default: "",
visibleIndex: 0,
}); });
Survey.JsonObject.metaData.addProperty("question", {
name: "transcript",
type: "text",
category: "general",
default: "",
visibleIndex: 0,
});
Survey.JsonObject.metaData.addProperty("question", {
name: "options",
type: "text",
category: "general",
default: "",
visibleIndex: 0,
});
Survey.JsonObject.metaData.addProperty("question", {
name: "correctAnswers",
type: "text",
category: "general",
default: "",
visibleIndex: 0,
});
// Load survey model from JSON // Load survey model from JSON
const survey = new Survey.Model(jsonStatic); survey = new Survey.Model(jsonStatic);
// Instantiate `markdown-it` // Instantiate `markdown-it`
const converter = markdownit({ converter = markdownit({
html: true // Support HTML tags in the source (unsafe, see documentation) html: true // Support HTML tags in the source
}); });
survey.onTextMarkdown.add((_, options) => { survey.onTextMarkdown.add((_, options) => {
// Convert Markdown to HTML
let str = converter.renderInline(options.text); let str = converter.renderInline(options.text);
// ...
// Sanitize the HTML markup using a third-party library here
// ...
// Set HTML markup to render
options.html = str; options.html = str;
}); });
...@@ -71,16 +201,49 @@ $(function () { ...@@ -71,16 +201,49 @@ $(function () {
$(options.htmlElement).addClass("hide-disabled-checkboxes"); $(options.htmlElement).addClass("hide-disabled-checkboxes");
} }
} }
// Display compComment if present
if (options.question.compComment) {
const compCommentElement = document.createElement('div');
compCommentElement.className = 'comp-comment';
compCommentElement.innerHTML = options.question.compComment;
options.htmlElement.appendChild(compCommentElement);
}
// Add "Corrigé" button if helpComment is present
if (options.question.helpComment) {
const helpButton = document.createElement('button');
helpButton.innerHTML = 'Corrigé';
helpButton.className = 'sd-btn sd-btn--action nav-input';
helpButton.onclick = () => toggleHelpComment(options.question, options.htmlElement);
options.htmlElement.appendChild(helpButton);
}
if (options.question.getType() === "dropdown") {
// Very ugly fix to avoid sliding dropdown on focus
$('.book-article').css({
'will-change': 'unset',
'transition': 'none',
});
$('.book-page').css({
'will-change': 'unset',
'transition': 'none',
});
}
}); });
// Render the appropriate input method for each question
survey.onAfterRenderQuestion.add((survey, options) => {
if (options.question.getType() === 'html') {
renderInputMethod(options.question, survey.currentPage.elements.indexOf(options.question));
}
});
// Add "Check answers" button // Add "Check answers" button
survey.addNavigationItem({ survey.addNavigationItem({
id: "sv-nav-check", id: "sv-nav-check",
title: "Vérifier", title: "Vérifier",
action: () => { action: checkAnswers,
checkAllQuestions(survey.currentPage.questions, jsonStatic, converter);
},
css: "nav-button", css: "nav-button",
innerCss: "sd-btn sd-btn--action nav-input" innerCss: "sd-btn sd-btn--action nav-input"
}); });
...@@ -89,16 +252,63 @@ $(function () { ...@@ -89,16 +252,63 @@ $(function () {
survey.addNavigationItem({ survey.addNavigationItem({
id: "sv-nav-clear", id: "sv-nav-clear",
title: "Effacer", title: "Effacer",
action: () => { action: clearAnswers,
clearAllQuestions(survey.currentPage.questions);
},
css: "nav-button", css: "nav-button",
innerCss: "sd-btn nav-input" innerCss: "sd-btn nav-input"
}); });
survey.onComplete.add(function (sender) {
if (sender.isSurveySummaryVisible) {
console.log("Survey summary is visible");
const userData = sender.data;
const summaryDiv = document.createElement("div");
summaryDiv.id = "surveySummary";
let html = "<h3>Your Results:</h3><ul>";
sender.getAllQuestions().forEach(q => {
const userAnswer = userData[q.name];
const correctAnswer = q.correctAnswer;
const isCorrect = userAnswer === correctAnswer;
html += `<li><b>${q.title}</b><br>
Your answer: ${userAnswer} <br>
Correct answer: ${correctAnswer} <br>
<span style="color:${isCorrect ? 'green' : 'red'};">
${isCorrect ? "Correct" : "Incorrect"}
</span>`;
// Check if the transcript property exists and add an image if it does
if (q.transcript) {
html += `<br><img src="${q.transcript}" alt="Transcript Image" class="inlineImage">`;
}
html += `</li><br>`;
});
html += "</ul>";
summaryDiv.innerHTML = html;
// Append the summary after the survey container
document.getElementById("surveyContainer").appendChild(summaryDiv);
}
});
// Ugly tricks to avoid creating a new theme
const customTheme = SurveyTheme.DefaultLightPanelless;
const primColor = getComputedStyle(document.documentElement, null).getPropertyValue('--macao-primary-color');
customTheme.cssVariables["--sjs-primary-backcolor"] = primColor;
customTheme.cssVariables["--sjs-primary-backcolor-dark"] = primColor;
// Apply theme // Apply theme
survey.applyTheme(SurveyTheme.DefaultLightPanelless); survey.applyTheme(customTheme);
console.log("Survey theme applied", customTheme);
survey.showCompleteButton = false;
// Inflate the survey in the page // Inflate the survey in the page
$("#surveyContainer").Survey({ model: survey }); $("#surveyContainer").Survey({ model: survey });
}); });
$(document).ready(function() {
$('button:contains("Play")').html('<i class="fa-solid fa-play"></i> Écouter').addClass('btn-play').prop('title', 'Écouter');
});
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>full</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
...@@ -4,13 +4,11 @@ weight = 30 ...@@ -4,13 +4,11 @@ weight = 30
+++ +++
Ecoutez et complétez les deux énoncés suivants en vous servant de Écoutez et complétez les deux énoncés suivants en vous servant de
vos connaissances grammaticales. vos connaissances grammaticales.
<div class="commentaireInfoGroup"> <div class="commentaireInfoGroup" hidden="True">
<div class="commentaireInfo">
</div>
</div> </div>
{{< quiz >}} {{< quiz >}}
...@@ -5,16 +5,12 @@ weight = 60 ...@@ -5,16 +5,12 @@ weight = 60
Ecoutez l'énoncé : Écoutez l'énoncé :
| <img src="/macao-hugo/media/ecouteur_macao.png" id="ecouteur_macao.png"/> | <div><audio id="ecran211_04.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_04.mp3').play()">Play</button></div><div><audio id="ecran211_01.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_01.mp3').play()">Play</button></div> |
| --- | --- |
<audio id="ecran211_04.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_04.mp3').play()">Play</button><audio id="ecran211_01.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_01.mp3').play()">Play</button>
Cet énoncé renvoie-t-il à une situation réelle ? Cet énoncé renvoie-t-il à une situation réelle ?
<div class="commentaireInfoGroup"> <div class="commentaireInfoGroup" hidden="True">
<div class="commentaireInfo">
</div>
</div> </div>
{{< quiz >}} {{< quiz >}}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"elements": [ "elements": [
{ {
"name": "pg191", "name": "pg191",
"titleLocation": "hidden",
"type": "radiogroup", "type": "radiogroup",
"choices": [ "choices": [
{ {
......
...@@ -3,17 +3,13 @@ title = "Sixième tâche" ...@@ -3,17 +3,13 @@ title = "Sixième tâche"
weight = 100 weight = 100
+++ +++
Ecoutez : Écoutez :
| <img src="/macao-hugo/media/ecouteur_macao.png" id="ecouteur_macao.png"/> | <div><audio id="ecran26_01.mp3" ><source src="/macao-hugo/media/ecran26/ecran26_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran26_01.mp3').play()">Play</button></div> |
| --- | --- |
<audio id="ecran26_01.mp3" ><source src="/macao-hugo/media/ecran26/ecran26_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran26_01.mp3').play()">Play</button>
Sélectionnez ce que vous avez entendu. Sélectionnez ce que vous avez entendu.
<div class="commentaireInfoGroup"> <div class="commentaireInfoGroup" hidden="True">
<div class="commentaireInfo">
</div>
</div> </div>
{{< quiz >}} {{< quiz >}}
...@@ -4,18 +4,14 @@ weight = 10 ...@@ -4,18 +4,14 @@ weight = 10
+++ +++
Ecoutez l'énoncé et remettez les éléments ci-dessous dans Écoutez l'énoncé et remettez les éléments ci-dessous dans
l'ordre de l'ordre de
l'énoncé entendu : l'énoncé entendu :
| <img src="/macao-hugo/media/ecouteur_macao.png" id="ecouteur_macao.png"/> | | <audio id="ecran17_04.mp3" ><source src="/macao-hugo/media/ecran17/ecran17_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran17_04.mp3').play()">Play</button><audio id="ecran17_01.mp3" ><source src="/macao-hugo/media/ecran17/ecran17_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran17_01.mp3').play()">Play</button>
| --- | --- |
| <div><audio id="ecran17_04.mp3" ><source src="/macao-hugo/media/ecran17/ecran17_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran17_04.mp3').play()">Play</button></div><div><audio id="ecran17_01.mp3" ><source src="/macao-hugo/media/ecran17/ecran17_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran17_01.mp3').play()">Play</button></div> | |
<div class="commentaireInfoGroup"> <div class="commentaireInfoGroup" hidden="True">
<div class="commentaireInfo">
</div>
</div> </div>
{{< quiz >}} {{< quiz >}}
...@@ -5,18 +5,14 @@ weight = 40 ...@@ -5,18 +5,14 @@ weight = 40
Ecoutez les deux énoncés suivants. Écoutez les deux énoncés suivants.
| <img src="/macao-hugo/media/ecouteur_macao.png" id="ecouteur_macao.png"/> | | <audio id="ecran201_04.mp3" ><source src="/macao-hugo/media/ecran201/ecran201_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran201_04.mp3').play()">Play</button><audio id="ecran201_01.mp3" ><source src="/macao-hugo/media/ecran201/ecran201_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran201_01.mp3').play()">Play</button> Whenever I phone her <audio id="mots20itape1_01.mp3" ><source src="/macao-hugo/media/mots20itape1/mots20itape1_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('mots20itape1_01.mp3').play()">Play</button> the conversation.
| --- | --- | <audio id="ecran202_04.mp3" ><source src="/macao-hugo/media/ecran202/ecran202_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran202_04.mp3').play()">Play</button><audio id="ecran202_01.mp3" ><source src="/macao-hugo/media/ecran202/ecran202_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran202_01.mp3').play()">Play</button> If I had a tape recorder <audio id="mots20id_tape1_01.mp3" ><source src="/macao-hugo/media/mots20id_tape1/mots20id_tape1_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('mots20id_tape1_01.mp3').play()">Play</button> the conversation.
| <div><audio id="ecran201_04.mp3" ><source src="/macao-hugo/media/ecran201/ecran201_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran201_04.mp3').play()">Play</button></div><div><audio id="ecran201_01.mp3" ><source src="/macao-hugo/media/ecran201/ecran201_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran201_01.mp3').play()">Play</button></div> | Whenever I phone her <div><audio id="mots20itape1_01.mp3" ><source src="/macao-hugo/media/mots20itape1/mots20itape1_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('mots20itape1_01.mp3').play()">Play</button></div> the conversation. |
| <div><audio id="ecran202_04.mp3" ><source src="/macao-hugo/media/ecran202/ecran202_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran202_04.mp3').play()">Play</button></div><div><audio id="ecran202_01.mp3" ><source src="/macao-hugo/media/ecran202/ecran202_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran202_01.mp3').play()">Play</button></div> | If I had a tape recorder <div><audio id="mots20id_tape1_01.mp3" ><source src="/macao-hugo/media/mots20id_tape1/mots20id_tape1_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('mots20id_tape1_01.mp3').play()">Play</button></div> the conversation. |
Que diriez-vous des blocs mis en valeur ? Que diriez-vous des blocs mis en valeur ?
<div class="commentaireInfoGroup"> <div class="commentaireInfoGroup" hidden="True">
<div class="commentaireInfo">
</div>
</div> </div>
{{< quiz >}} {{< quiz >}}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"elements": [ "elements": [
{ {
"name": "pg3746", "name": "pg3746",
"titleLocation": "hidden",
"type": "radiogroup", "type": "radiogroup",
"choices": [ "choices": [
{ {
......
...@@ -7,16 +7,12 @@ weight = 20 ...@@ -7,16 +7,12 @@ weight = 20
Réécoutez l'énoncé : Réécoutez l'énoncé :
| <img src="/macao-hugo/media/ecouteur_macao.png" id="ecouteur_macao.png"/> | <div><audio id="ecran17_04.mp3" ><source src="/macao-hugo/media/ecran17/ecran17_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran17_04.mp3').play()">Play</button></div><div><audio id="ecran17_01.mp3" ><source src="/macao-hugo/media/ecran17/ecran17_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran17_01.mp3').play()">Play</button></div> | <audio id="ecran17_04.mp3" ><source src="/macao-hugo/media/ecran17/ecran17_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran17_04.mp3').play()">Play</button><audio id="ecran17_01.mp3" ><source src="/macao-hugo/media/ecran17/ecran17_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran17_01.mp3').play()">Play</button>
| --- | --- | Est-ce qu'on entend distinctement **'s** ?
--- ---
| Est-ce qu'on entend distinctement | | **'s** | | --- | | ? |
| --- | --- | --- | --- |
<div class="commentaireInfoGroup" hidden="True">
<div class="commentaireInfoGroup">
<div class="commentaireInfo">
</div>
</div> </div>
{{< quiz >}} {{< quiz >}}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"elements": [ "elements": [
{ {
"name": "pg6329", "name": "pg6329",
"titleLocation": "hidden",
"type": "radiogroup", "type": "radiogroup",
"choices": [ "choices": [
{ {
......
...@@ -4,15 +4,11 @@ weight = 80 ...@@ -4,15 +4,11 @@ weight = 80
+++ +++
Ecoutez à nouveau l'énoncé et complétez. Écoutez à nouveau l'énoncé et complétez.
| <img src="/macao-hugo/media/ecouteur_macao.png" id="ecouteur_macao.png"/> | <div><audio id="ecran211_04.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_04.mp3').play()">Play</button></div><div><audio id="ecran211_01.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_01.mp3').play()">Play</button></div> | <audio id="ecran211_04.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_04.mp3').play()">Play</button><audio id="ecran211_01.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_01.mp3').play()">Play</button>
| --- | --- |
<div class="commentaireInfoGroup" hidden="True">
<div class="commentaireInfoGroup">
<div class="commentaireInfo">
</div>
</div> </div>
{{< quiz >}} {{< quiz >}}
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
} }
] ]
, ,
"correctComment": "\n\nBravo. A l'oreille, il est difficile de distinguer la présence de ***would***, avec ***do***\nqui le suit. Il est donc utile dans ce cas de se servir d'indices grammaticaux figurant dans le contexte.\n\n", "correctComment": "\n\nBravo. À l'oreille, il est difficile de distinguer la présence de ***would***, avec ***do***\nqui le suit. Il est donc utile dans ce cas de se servir d'indices grammaticaux figurant dans le contexte.\n\n",
"incorrectComment": "\n\nVous vous trompez. L'énoncé commence par ***I would do*** (ou : ***I'd do***). Votre erreur\npeut s'expliquer car à l'oreille, il est difficile de distinguer la présence de ***would***, avec\n***do*** qui le suit. Il est donc utile dans ce cas de se servir d'indices grammaticaux figurant\ndans le contexte.\n\n"} "incorrectComment": "\n\nVous vous trompez. L'énoncé commence par ***I would do*** (ou : ***I'd do***). Votre erreur\npeut s'expliquer car à l'oreille, il est difficile de distinguer la présence de ***would***, avec\n***do*** qui le suit. Il est donc utile dans ce cas de se servir d'indices grammaticaux figurant\ndans le contexte.\n\n"}
...@@ -5,16 +5,12 @@ weight = 50 ...@@ -5,16 +5,12 @@ weight = 50
Ecoutez l'énoncé : Écoutez l'énoncé :
| <img src="/macao-hugo/media/ecouteur_macao.png" id="ecouteur_macao.png"/> | <div><audio id="ecran211_04.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_04.mp3').play()">Play</button></div><div><audio id="ecran211_01.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_01.mp3').play()">Play</button></div> |
| --- | --- |
<audio id="ecran211_04.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_04.mp3').play()">Play</button><audio id="ecran211_01.mp3" ><source src="/macao-hugo/media/ecran211/ecran211_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran211_01.mp3').play()">Play</button>
Cet énoncé comporte-t-il une hypothèse ? Cet énoncé comporte-t-il une hypothèse ?
<div class="commentaireInfoGroup"> <div class="commentaireInfoGroup" hidden="True">
<div class="commentaireInfo">
</div>
</div> </div>
{{< quiz >}} {{< quiz >}}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"elements": [ "elements": [
{ {
"name": "pg7434", "name": "pg7434",
"titleLocation": "hidden",
"type": "radiogroup", "type": "radiogroup",
"choices": [ "choices": [
{ {
......
...@@ -5,18 +5,14 @@ weight = 90 ...@@ -5,18 +5,14 @@ weight = 90
Ecoutez les deux énoncés suivants. Écoutez les deux énoncés suivants.
| <img src="/macao-hugo/media/ecouteur_macao.png" id="ecouteur_macao.png"/> | | <audio id="ecran251_04.mp3" ><source src="/macao-hugo/media/ecran251/ecran251_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran251_04.mp3').play()">Play</button><audio id="ecran251_01.mp3" ><source src="/macao-hugo/media/ecran251/ecran251_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran251_01.mp3').play()">Play</button> I wish I could go to Africa. <audio id="mots25there_01.mp3" ><source src="/macao-hugo/media/mots25there/mots25there_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('mots25there_01.mp3').play()">Play</button> so many different languages there.
| --- | --- | <audio id="ecran252_04.mp3" ><source src="/macao-hugo/media/ecran252/ecran252_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran252_04.mp3').play()">Play</button><audio id="ecran252_01.mp3" ><source src="/macao-hugo/media/ecran252/ecran252_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran252_01.mp3').play()">Play</button> They've moved back to London. <audio id="mots25they_01.mp3" ><source src="/macao-hugo/media/mots25they/mots25they_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('mots25they_01.mp3').play()">Play</button> so happy to live in the capital again.
| <div><audio id="ecran251_04.mp3" ><source src="/macao-hugo/media/ecran251/ecran251_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran251_04.mp3').play()">Play</button></div><div><audio id="ecran251_01.mp3" ><source src="/macao-hugo/media/ecran251/ecran251_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran251_01.mp3').play()">Play</button></div> | I wish I could go to Africa. <div><audio id="mots25there_01.mp3" ><source src="/macao-hugo/media/mots25there/mots25there_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('mots25there_01.mp3').play()">Play</button></div> so many different languages there. |
| <div><audio id="ecran252_04.mp3" ><source src="/macao-hugo/media/ecran252/ecran252_04.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran252_04.mp3').play()">Play</button></div><div><audio id="ecran252_01.mp3" ><source src="/macao-hugo/media/ecran252/ecran252_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('ecran252_01.mp3').play()">Play</button></div> | They've moved back to London. <div><audio id="mots25they_01.mp3" ><source src="/macao-hugo/media/mots25they/mots25they_01.mp3" type="audio/mpeg"></audio><button onclick="document.getElementById('mots25they_01.mp3').play()">Play</button></div> so happy to live in the capital again. |
Que diriez-vous des blocs mis en valeur ? Que diriez-vous des blocs mis en valeur ?
<div class="commentaireInfoGroup"> <div class="commentaireInfoGroup" hidden="True">
<div class="commentaireInfo">
</div>
</div> </div>
{{< quiz >}} {{< quiz >}}