Skip to content

Commit

Permalink
feat(api): add embed non auto to didacticiel-modulix.json
Browse files Browse the repository at this point in the history
Co-authored-by: Clément Latzarus <clement.latzarus@pix.fr>
  • Loading branch information
2 people authored and dlahaye committed Jul 3, 2024
1 parent b8a9039 commit fb9320e
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,54 @@
}
]
},
{
"id": "46577fb1-aadb-49ba-b3fd-721a11da8eb4",
"type": "activity",
"title": "Embed non-auto",
"components": [
{
"type": "element",
"element": {
"id": "0e3315fd-98ad-492f-9046-4aa867495d84",
"type": "embed-non-auto",
"url": "https://epreuves.pix.fr/fake2.html",
"height": 640,
"title": "Application"
}
},
{
"type": "element",
"element": {
"id": "74d63ec2-f3e3-4ffe-9806-208d33588553",
"type": "qcm",
"instruction": "<p>Parcourez ces photos trouvées sur le Web : lesquelles correspondent à des situations fictives&#8239;?</p>",
"proposals": [
{
"id": "1",
"content": "Photo 1"
},
{
"id": "2",
"content": "Photo 2"
},
{
"id": "3",
"content": "Photo 3"
},
{
"id": "4",
"content": "Photo 4"
}
],
"feedbacks": {
"valid": "<span class=\"feedback__state\">Correct&#8239;!</span>",
"invalid": "<span class=\"feedback__state\">Et non&#8239;!</span>"
},
"solutions": ["1", "2", "4"]
}
}
]
},
{
"id": "7cf75e70-8749-4392-8081-f2c02badb0fb",
"type": "activity",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Joi from 'joi';

import { htmlNotAllowedSchema, uuidSchema } from '../utils.js';

const embedNonAutoElementSchema = Joi.object({
id: uuidSchema,
type: Joi.string().valid('embed-non-auto').required(),
title: htmlNotAllowedSchema.required(),
url: Joi.string().uri().required(),
height: Joi.number().min(0).required(),
}).required();

export { embedNonAutoElementSchema };
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { embedNonAutoElementSchema } from './embed-non-auto.js';
import { imageElementSchema } from './image.js';
import { qcmElementSchema } from './qcm.js';
import { qcuElementSchema } from './qcu.js';
Expand All @@ -8,6 +9,7 @@ import { videoElementSchema } from './video.js';
export {
blockInputSchema,
blockSelectSchema,
embedNonAutoElementSchema,
imageElementSchema,
qcmElementSchema,
qcuElementSchema,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Joi from 'joi';

import {
embedNonAutoElementSchema,
imageElementSchema,
qcmElementSchema,
qcuElementSchema,
Expand Down Expand Up @@ -31,6 +32,7 @@ const elementSchema = Joi.alternatives().conditional('.type', {
{ is: 'qcm', then: qcmElementSchema },
{ is: 'qrocm', then: qrocmElementSchema },
{ is: 'video', then: videoElementSchema },
{ is: 'embed-non-auto', then: embedNonAutoElementSchema },
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Fonctionnalité: Accessibilité de Modulix
Quand je vais au grain suivant
Quand je vais au grain suivant
Quand je vais au grain suivant
Quand je vais au grain suivant
Alors la page devrait être accessible
Quand je clique sur "Terminer"
Et que j'attends 500 ms
Expand Down

0 comments on commit fb9320e

Please sign in to comment.