CLASSROOMIO-T-195: Exercise Templates for JS

CLASSROOMIO-T-195: Shuffle options to mix correct answers

Merge branch 'main' of https://gitlab.com/thenextgreat/classroomio into CLASSROOMIO-T-195

CLASSROOMIO-T-195: Exercise Templates for JS


Co-authored-by: Rotimi Best <rotimiibitoyeemma@gmail.com>
Co-authored-by: Tunji Adeyemi <tunji@digdippa.com>


Merge-request: CLASSROOMIO-MR-92
Merged-by: Best Admin <best@digdippa.com>
This commit is contained in:
tunny17
2023-10-07 05:27:11 +00:00
committed by Space Cloud
co-authored by Rotimi Best
parent e0812c66c1
commit 0f01e8e574
23 changed files with 4442 additions and 2 deletions
+220
View File
@@ -0,0 +1,220 @@
import { QuestionTypes } from '../utils';
import type { ExerciseTemplate } from '$lib/utils/types';
const template: ExerciseTemplate = {
title: 'JavaScript Comments Quiz',
description: 'Test your knowledge of JavaScript comments.',
questionnaire: {
questions: [
{
title: 'What is the correct way to add a single-line comment in JavaScript?',
name: 'q1',
points: 1,
order: 1,
question_type: QuestionTypes[0], // RADIO type
options: [
{
label: '// This is a comment',
is_correct: true
},
{
label: '-- This is a comment',
is_correct: false
},
{
label: '# This is a comment',
is_correct: false
}
]
},
{
title: 'How do you add a multi-line comment in JavaScript?',
name: 'q2',
points: 1,
order: 2,
question_type: QuestionTypes[0], // RADIO type
options: [
{
label: '/* This is a multi-line comment */',
is_correct: true
},
{
label: '// This is a multi-line comment',
is_correct: false
},
{
label: '-- This is a multi-line comment',
is_correct: false
}
]
},
{
title: 'Which of the following is NOT a valid comment syntax in JavaScript?',
name: 'q3',
points: 1,
order: 3,
question_type: QuestionTypes[0], // RADIO type
options: [
{
label: '/? This is a comment',
is_correct: false
},
{
label: '/* This is a comment',
is_correct: false
},
{
label: '// This is a comment',
is_correct: true
}
]
},
{
title: 'What is the purpose of comments in JavaScript?',
name: 'q4',
points: 1,
order: 4,
question_type: QuestionTypes[0], // RADIO type
options: [
{
label: 'To provide explanations and make the code more readable',
is_correct: true
},
{
label: 'To hide code from other developers',
is_correct: false
},
{
label: 'To execute code',
is_correct: false
}
]
},
{
title: 'Can comments be nested in JavaScript?',
name: 'q5',
points: 1,
order: 5,
question_type: QuestionTypes[0], // RADIO type
options: [
{
label: 'Yes',
is_correct: true
},
{
label: 'No',
is_correct: false
}
]
},
{
title: "What happens to comments in JavaScript code when it's executed by a browser?",
name: 'q6',
points: 1,
order: 6,
question_type: QuestionTypes[0], // RADIO type
options: [
{
label: 'Comments are ignored and not executed',
is_correct: true
},
{
label: 'Comments cause errors in the code',
is_correct: false
},
{
label: 'Comments are executed like regular code',
is_correct: false
}
]
},
{
title: 'What is the purpose of commenting out code in JavaScript?',
name: 'q7',
points: 1,
order: 7,
question_type: QuestionTypes[0], // RADIO type
options: [
{
label: 'To temporarily disable code',
is_correct: true
},
{
label: 'To hide code from other developers',
is_correct: false
},
{
label: 'To improve code performance',
is_correct: false
}
]
},
{
title: 'Which comment style is recommended for adding documentation comments in JavaScript?',
name: 'q8',
points: 1,
order: 8,
question_type: QuestionTypes[0], // RADIO type
options: [
{
label: 'JSDoc style (/** ... */)',
is_correct: true
},
{
label: 'Single-line style (// ...)',
is_correct: false
},
{
label: 'Block comment style (/* ... */)',
is_correct: false
}
]
},
{
title: 'What is the purpose of the "debugger" statement in JavaScript code?',
name: 'q9',
points: 1,
order: 9,
question_type: QuestionTypes[0], // RADIO type
options: [
{
label: 'To pause code execution and open the browser debugger',
is_correct: true
},
{
label: 'To generate debugging logs',
is_correct: false
},
{
label: 'To display a message in the console',
is_correct: false
}
]
},
{
title: 'Which of the following is NOT a recommended use of comments in JavaScript?',
name: 'q10',
points: 1,
order: 10,
question_type: QuestionTypes[0], // RADIO type
options: [
{
label: 'Adding explanations to code',
is_correct: false
},
{
label: 'Hiding code from other developers',
is_correct: true
},
{
label: 'Documenting functions and APIs',
is_correct: false
}
]
}
]
}
};
export default template;