CLASSROOMIO-T-193: Exercise Templates for HTML
CLASSROOMIO-T-193: Convert to single quotes CLASSROOMIO-T-193: Resolved Feedbacks landing page improvement add spacing on mobile for notes in lms little bug fixes in lms CLASSROOMIO-T-193: return the array Simplify template generation CLASSROOMIO-T-193: Styling improvement CLASSROOMIO-T-193: Exercise Templates for HTML Co-authored-by: Rotimi Best <rotimiibitoyeemma@gmail.com> Co-authored-by: Tunji Adeyemi <tunji@digdippa.com> Merge-request: CLASSROOMIO-MR-88 Merged-by: Best Admin <best@digdippa.com>
This commit is contained in:
committed by
Space Cloud
co-authored by
Rotimi Best
parent
e57bd4a4bf
commit
849154711b
+25
-30
@@ -1,4 +1,6 @@
|
||||
import { HTML_IDS, HTML_TEMPLATES } from './html';
|
||||
import { calculateTotalPoints } from './utils';
|
||||
import type { ExerciseTemplate } from '$lib/utils/types';
|
||||
|
||||
export const TAGS = {
|
||||
HTML: 'HTML',
|
||||
@@ -9,37 +11,30 @@ export const TAGS = {
|
||||
VueJS: 'VueJS'
|
||||
};
|
||||
|
||||
function generateTemplateForTag(
|
||||
keys: { [key: string]: string },
|
||||
templates: {
|
||||
[x: string]: ExerciseTemplate;
|
||||
}
|
||||
) {
|
||||
const template = [];
|
||||
|
||||
for (const key in keys) {
|
||||
const id = keys[key];
|
||||
template.push({
|
||||
id,
|
||||
title: templates[id].title,
|
||||
questions: templates[id].questionnaire.questions.length,
|
||||
points: calculateTotalPoints(templates[id]),
|
||||
data: templates[id]
|
||||
});
|
||||
}
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
export const TEMPLATES = {
|
||||
[TAGS.HTML]: [
|
||||
{
|
||||
id: HTML_IDS.HTML_ELEMENTS,
|
||||
title: 'Learn HTML Elements',
|
||||
questions: 10,
|
||||
points: 20,
|
||||
data: HTML_TEMPLATES[HTML_IDS.HTML_ELEMENTS]
|
||||
},
|
||||
{
|
||||
id: HTML_IDS.HTML_ATTRIBUTES,
|
||||
title: 'HTML Attributes',
|
||||
questions: 5,
|
||||
points: 10,
|
||||
data: HTML_TEMPLATES[HTML_IDS.HTML_ATTRIBUTES]
|
||||
},
|
||||
{
|
||||
id: HTML_IDS.HTML_HEADINGS,
|
||||
title: 'Practice HTML Headings',
|
||||
questions: 15,
|
||||
points: 50,
|
||||
data: HTML_TEMPLATES[HTML_IDS.HTML_ELEMENTS]
|
||||
},
|
||||
{
|
||||
id: HTML_IDS.HTML_PARAGRAPH,
|
||||
title: 'Understand p tag',
|
||||
questions: 15,
|
||||
points: 20,
|
||||
data: HTML_TEMPLATES[HTML_IDS.HTML_ELEMENTS]
|
||||
}
|
||||
],
|
||||
[TAGS.HTML]: generateTemplateForTag(HTML_IDS, HTML_TEMPLATES),
|
||||
[TAGS.CSS]: [],
|
||||
[TAGS.JS]: [],
|
||||
[TAGS.Typescript]: [],
|
||||
|
||||
Reference in New Issue
Block a user