From caf14369280f3e3a78092aed2ea93b47ed7fede3 Mon Sep 17 00:00:00 2001 From: tunny17 Date: Wed, 11 Oct 2023 11:47:51 +0000 Subject: [PATCH] CLASSROOMIO-T-212: Exercise Templates for GIT CLASSROOMIO-T-212: Questions Fix CLASSROOMIO-T-212: Exercise Templates for GIT Co-authored-by: Tunji Adeyemi Merge-request: CLASSROOMIO-MR-99 Merged-by: Best Admin --- src/lib/mocks/git/001_git_newFiles.ts | 125 +++++++++++++ src/lib/mocks/git/002_git_staging.ts | 125 +++++++++++++ src/lib/mocks/git/003_git_commit.ts | 125 +++++++++++++ src/lib/mocks/git/004_git_amend.ts | 125 +++++++++++++ src/lib/mocks/git/005_git_branch.ts | 125 +++++++++++++ src/lib/mocks/git/006_git_branchMerge.ts | 125 +++++++++++++ src/lib/mocks/git/007_git_pull.ts | 125 +++++++++++++ src/lib/mocks/git/008_git_push.ts | 125 +++++++++++++ src/lib/mocks/git/009_git_githubBranch.ts | 125 +++++++++++++ src/lib/mocks/git/010_git_branchPull.ts | 125 +++++++++++++ src/lib/mocks/git/011_git_branchPush.ts | 213 ++++++++++++++++++++++ src/lib/mocks/git/012_git_githubFlow.ts | 198 ++++++++++++++++++++ src/lib/mocks/git/013_git_githubPages.ts | 198 ++++++++++++++++++++ src/lib/mocks/git/014_git_githubFork.ts | 198 ++++++++++++++++++++ src/lib/mocks/git/015_git_clone.ts | 198 ++++++++++++++++++++ src/lib/mocks/git/016_git_pullRequest.ts | 202 ++++++++++++++++++++ src/lib/mocks/git/017_git_ignore.ts | 198 ++++++++++++++++++++ src/lib/mocks/git/018_gitSsh.ts | 185 +++++++++++++++++++ src/lib/mocks/git/019_git_revert.ts | 185 +++++++++++++++++++ src/lib/mocks/git/020_git_reset.ts | 159 ++++++++++++++++ src/lib/mocks/git/index.ts | 66 +++++++ src/lib/mocks/index.ts | 7 +- 22 files changed, 3255 insertions(+), 2 deletions(-) create mode 100644 src/lib/mocks/git/001_git_newFiles.ts create mode 100644 src/lib/mocks/git/002_git_staging.ts create mode 100644 src/lib/mocks/git/003_git_commit.ts create mode 100644 src/lib/mocks/git/004_git_amend.ts create mode 100644 src/lib/mocks/git/005_git_branch.ts create mode 100644 src/lib/mocks/git/006_git_branchMerge.ts create mode 100644 src/lib/mocks/git/007_git_pull.ts create mode 100644 src/lib/mocks/git/008_git_push.ts create mode 100644 src/lib/mocks/git/009_git_githubBranch.ts create mode 100644 src/lib/mocks/git/010_git_branchPull.ts create mode 100644 src/lib/mocks/git/011_git_branchPush.ts create mode 100644 src/lib/mocks/git/012_git_githubFlow.ts create mode 100644 src/lib/mocks/git/013_git_githubPages.ts create mode 100644 src/lib/mocks/git/014_git_githubFork.ts create mode 100644 src/lib/mocks/git/015_git_clone.ts create mode 100644 src/lib/mocks/git/016_git_pullRequest.ts create mode 100644 src/lib/mocks/git/017_git_ignore.ts create mode 100644 src/lib/mocks/git/018_gitSsh.ts create mode 100644 src/lib/mocks/git/019_git_revert.ts create mode 100644 src/lib/mocks/git/020_git_reset.ts create mode 100644 src/lib/mocks/git/index.ts diff --git a/src/lib/mocks/git/001_git_newFiles.ts b/src/lib/mocks/git/001_git_newFiles.ts new file mode 100644 index 00000000..603a8442 --- /dev/null +++ b/src/lib/mocks/git/001_git_newFiles.ts @@ -0,0 +1,125 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git New Files Quiz', + description: 'Test your knowledge of adding new files in Git', + questionnaire: { + questions: [ + { + title: 'What command is used to stage all new files for a commit in Git?', + name: 'question1', + points: 2, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'git add .', is_correct: true }, + { label: 'git commit -m', is_correct: false }, + { label: 'git push origin', is_correct: false }, + ], + }, + { + title: 'What does "git status" show for new files?', + name: 'question2', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'Untracked files', is_correct: true }, + { label: 'Staged files', is_correct: false }, + { label: 'Committed files', is_correct: false }, + { label: 'Modified files', is_correct: false }, + ], + }, + { + title: 'Explain the purpose of "git add" in your own words.', + name: 'question3', + points: 2, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the recommended way to unstage a file in Git?', + name: 'question4', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'git unstage', is_correct: false }, + { label: 'git reset HEAD', is_correct: true }, + { label: 'git checkout', is_correct: false }, + ], + }, + { + title: 'How can you commit only specific new files in Git?', + name: 'question5', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'Use "git commit -a"', is_correct: false }, + { label: 'Add the specific files with "git add" and then commit', is_correct: true }, + { label: 'Use "git commit --all"', is_correct: false }, + { label: 'Use "git commit -m"', is_correct: false }, + ], + }, + { + title: 'What is the purpose of "git diff" for new files?', + name: 'question6', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What does "git stash" do?', + name: 'question7', + points: 2, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'Deletes all your changes', is_correct: false }, + { label: 'Temporarily saves your changes', is_correct: true }, + { label: 'Creates a new branch', is_correct: false }, + ], + }, + { + title: 'What is the purpose of "git commit -m"?', + name: 'question8', + points: 2, + order: 8, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To stage new files', is_correct: false }, + { label: 'To commit changes with a specified message', is_correct: true }, + { label: 'To push changes to a remote repository', is_correct: false }, + { label: 'To create a new branch', is_correct: false }, + ], + }, + { + title: 'Explain the Git stash operation in your own words.', + name: 'question9', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of "git log"?', + name: 'question10', + points: 2, + order: 10, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'To view a list of available branches', is_correct: false }, + { label: 'To view the commit history', is_correct: true }, + { label: 'To merge branches', is_correct: false }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/002_git_staging.ts b/src/lib/mocks/git/002_git_staging.ts new file mode 100644 index 00000000..7ed31e96 --- /dev/null +++ b/src/lib/mocks/git/002_git_staging.ts @@ -0,0 +1,125 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Staging Environment Quiz', + description: 'Test your knowledge of Git Staging Environment', + questionnaire: { + questions: [ + { + title: 'What does the "git status" command display in the staging environment?', + name: 'question1', + points: 2, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'Changes staged for commit', is_correct: false }, + { label: 'Changes not staged for commit', is_correct: false }, + { label: 'Both staged and unstaged changes', is_correct: true }, + ], + }, + { + title: 'What is the purpose of the Git staging area?', + name: 'question2', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To store all changes made in the repository', is_correct: false }, + { label: 'To review changes before committing', is_correct: true }, + { label: 'To create new branches', is_correct: false }, + { label: 'To push changes to a remote repository', is_correct: false }, + ], + }, + { + title: 'Explain the process of staging changes in Git in your own words.', + name: 'question3', + points: 2, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How do you stage specific files for a commit in Git?', + name: 'question4', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'Use "git add ." to stage all changes', is_correct: false }, + { label: 'Use "git add filename" to stage a specific file', is_correct: true }, + { label: 'Use "git stage filename"', is_correct: false }, + ], + }, + { + title: 'What is the purpose of the "git reset" command in the staging environment?', + name: 'question5', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To unstage changes', is_correct: true }, + { label: 'To discard all changes', is_correct: false }, + { label: 'To create a new branch', is_correct: false }, + { label: 'To view the commit history', is_correct: false }, + ], + }, + { + title: 'What does "git diff" show in the staging environment?', + name: 'question6', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git stash?', + name: 'question7', + points: 2, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A temporary storage area for changes', is_correct: true }, + { label: 'A remote Git repository', is_correct: false }, + { label: 'A Git branch', is_correct: false }, + ], + }, + { + title: 'How do you unstage changes in Git?', + name: 'question8', + points: 2, + order: 8, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'Use "git stage filename"', is_correct: false }, + { label: 'Use "git unstage filename"', is_correct: true }, + { label: 'Use "git reset"', is_correct: true }, + { label: 'Use "git diff"', is_correct: false }, + ], + }, + { + title: 'Explain the Git stash operation in your own words.', + name: 'question9', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of "git log" in the staging environment?', + name: 'question10', + points: 2, + order: 10, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'To view a list of available branches', is_correct: false }, + { label: 'To view the commit history', is_correct: true }, + { label: 'To create a new branch', is_correct: false }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/003_git_commit.ts b/src/lib/mocks/git/003_git_commit.ts new file mode 100644 index 00000000..d621d0f3 --- /dev/null +++ b/src/lib/mocks/git/003_git_commit.ts @@ -0,0 +1,125 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Commit Quiz', + description: 'Test your knowledge of Git commits', + questionnaire: { + questions: [ + { + title: 'What is a Git commit?', + name: 'question1', + points: 2, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A snapshot of your code at a specific point in time', is_correct: true }, + { label: 'A type of Git branch', is_correct: false }, + { label: 'A remote repository', is_correct: false }, + ], + }, + { + title: 'What does the "git commit" command do?', + name: 'question2', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'Creates a new branch', is_correct: false }, + { label: 'Records changes to the repository', is_correct: true }, + { label: 'Deletes the current branch', is_correct: false }, + { label: 'Pushes changes to a remote repository', is_correct: false }, + ], + }, + { + title: 'Explain the purpose of "git commit" in your own words.', + name: 'question3', + points: 2, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git commit message?', + name: 'question4', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A comment about the weather', is_correct: false }, + { label: 'A brief description of the changes made in the commit', is_correct: true }, + { label: 'A list of all the files in the repository', is_correct: false }, + ], + }, + { + title: 'How do you commit changes with a message in Git?', + name: 'question5', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'Use "git commit -m"', is_correct: true }, + { label: 'Use "git push"', is_correct: false }, + { label: 'Use "git checkout"', is_correct: false }, + { label: 'Use "git add"', is_correct: false }, + ], + }, + { + title: 'What is the purpose of "git log"?', + name: 'question6', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git branch?', + name: 'question7', + points: 2, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A snapshot of your code at a specific point in time', is_correct: false }, + { label: 'A separate line of development', is_correct: true }, + { label: 'A Git commit message', is_correct: false }, + ], + }, + { + title: 'What is the purpose of "git reset" in relation to commits?', + name: 'question8', + points: 2, + order: 8, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To undo the last commit and reset the staging area', is_correct: true }, + { label: 'To create a new branch', is_correct: false }, + { label: 'To push changes to a remote repository', is_correct: false }, + { label: 'To view the commit history', is_correct: false }, + ], + }, + { + title: 'Explain the purpose of "git log" in your own words.', + name: 'question9', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git merge?', + name: 'question10', + points: 2, + order: 10, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A conflict resolution process', is_correct: false }, + { label: 'Combining changes from one branch into another', is_correct: true }, + { label: 'A Git repository backup', is_correct: false }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/004_git_amend.ts b/src/lib/mocks/git/004_git_amend.ts new file mode 100644 index 00000000..15cbff92 --- /dev/null +++ b/src/lib/mocks/git/004_git_amend.ts @@ -0,0 +1,125 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Amend Quiz', + description: 'Test your knowledge of Git Amend', + questionnaire: { + questions: [ + { + title: 'What does "git commit --amend" do?', + name: 'question1', + points: 2, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'Creates a new commit', is_correct: false }, + { label: 'Amends the last commit', is_correct: true }, + { label: 'Deletes the last commit', is_correct: false }, + ], + }, + { + title: 'What is the purpose of the Git amend operation?', + name: 'question2', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To add new files to the last commit', is_correct: false }, + { label: 'To modify the last commit message', is_correct: true }, + { label: 'To create a new branch', is_correct: false }, + { label: 'To revert to a previous commit', is_correct: false }, + ], + }, + { + title: 'Explain the command "git commit --amend" in your own words.', + name: 'question3', + points: 2, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git stash?', + name: 'question4', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A temporary storage area for changes', is_correct: true }, + { label: 'A remote Git repository', is_correct: false }, + { label: 'A Git branch', is_correct: false }, + ], + }, + { + title: 'How do you create a new branch in Git?', + name: 'question5', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git branch new-branch', is_correct: true }, + { label: 'git create-branch new-branch', is_correct: false }, + { label: 'git checkout -b new-branch', is_correct: true }, + { label: 'git new-branch', is_correct: false }, + ], + }, + { + title: 'What is a Git remote?', + name: 'question6', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git conflict?', + name: 'question7', + points: 2, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A disagreement between team members', is_correct: false }, + { label: 'A merge conflict when merging branches', is_correct: true }, + { label: 'A Git error message', is_correct: false }, + ], + }, + { + title: 'What is the purpose of "git pull"?', + name: 'question8', + points: 2, + order: 8, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To push changes to a remote repository', is_correct: false }, + { label: 'To update your local repository with changes from a remote repository', is_correct: true }, + { label: 'To create a new branch', is_correct: false }, + { label: 'To create a new commit', is_correct: false }, + ], + }, + { + title: 'Explain the Git stash operation.', + name: 'question9', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git tag?', + name: 'question10', + points: 2, + order: 10, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A label or pointer to a specific commit', is_correct: true }, + { label: 'A branch in Git', is_correct: false }, + { label: 'A type of Git remote', is_correct: false }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/005_git_branch.ts b/src/lib/mocks/git/005_git_branch.ts new file mode 100644 index 00000000..ee4d2181 --- /dev/null +++ b/src/lib/mocks/git/005_git_branch.ts @@ -0,0 +1,125 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Branch Quiz', + description: 'Test your knowledge of Git branches', + questionnaire: { + questions: [ + { + title: 'What is a Git branch?', + name: 'question1', + points: 2, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A snapshot of your code at a specific point in time', is_correct: false }, + { label: 'A separate line of development', is_correct: true }, + { label: 'A Git commit message', is_correct: false }, + ], + }, + { + title: 'How do you create a new branch in Git?', + name: 'question2', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git branch new-branch', is_correct: false }, + { label: 'git create-branch new-branch', is_correct: false }, + { label: 'git checkout -b new-branch', is_correct: true }, + { label: 'git new-branch', is_correct: false }, + ], + }, + { + title: 'Explain the purpose of Git branches in your own words.', + name: 'question3', + points: 2, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How do you switch between Git branches?', + name: 'question4', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'git checkout branch-name', is_correct: true }, + { label: 'git switch branch-name', is_correct: false }, + { label: 'git change-branch branch-name', is_correct: false }, + ], + }, + { + title: 'What is the purpose of the "git merge" command?', + name: 'question5', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To create a new branch', is_correct: false }, + { label: 'To merge changes from one branch into another', is_correct: true }, + { label: 'To view the commit history', is_correct: false }, + { label: 'To delete a branch', is_correct: false }, + ], + }, + { + title: 'What does "git branch" show you?', + name: 'question6', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git conflict?', + name: 'question7', + points: 2, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A disagreement between team members', is_correct: false }, + { label: 'A merge conflict when merging branches', is_correct: true }, + { label: 'A Git error message', is_correct: false }, + ], + }, + { + title: 'How do you delete a Git branch?', + name: 'question8', + points: 2, + order: 8, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git delete branch-name', is_correct: false }, + { label: 'git remove branch-name', is_correct: false }, + { label: 'git branch -d branch-name', is_correct: true }, + { label: 'git checkout branch-name', is_correct: false }, + ], + }, + { + title: 'Explain the Git conflict resolution process.', + name: 'question9', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of "git log" in relation to branches?', + name: 'question10', + points: 2, + order: 10, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'To view a list of available branches', is_correct: false }, + { label: 'To view the commit history of a branch', is_correct: true }, + { label: 'To create a new branch', is_correct: false }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/006_git_branchMerge.ts b/src/lib/mocks/git/006_git_branchMerge.ts new file mode 100644 index 00000000..93731d53 --- /dev/null +++ b/src/lib/mocks/git/006_git_branchMerge.ts @@ -0,0 +1,125 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Branch and Merge Quiz', + description: 'Test your knowledge of Git branch and merge operations', + questionnaire: { + questions: [ + { + title: 'What is a Git branch?', + name: 'question1', + points: 2, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A snapshot of your code at a specific point in time', is_correct: false }, + { label: 'A separate line of development', is_correct: true }, + { label: 'A Git commit message', is_correct: false }, + ], + }, + { + title: 'How do you create a new branch in Git?', + name: 'question2', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git branch new-branch', is_correct: false }, + { label: 'git create-branch new-branch', is_correct: false }, + { label: 'git checkout -b new-branch', is_correct: true }, + { label: 'git new-branch', is_correct: false }, + ], + }, + { + title: 'Explain the purpose of Git branches in your own words.', + name: 'question3', + points: 2, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How do you switch between Git branches?', + name: 'question4', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'git checkout branch-name', is_correct: true }, + { label: 'git switch branch-name', is_correct: false }, + { label: 'git change-branch branch-name', is_correct: false }, + ], + }, + { + title: 'What is the purpose of the "git merge" command?', + name: 'question5', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To create a new branch', is_correct: false }, + { label: 'To merge changes from one branch into another', is_correct: true }, + { label: 'To view the commit history', is_correct: false }, + { label: 'To delete a branch', is_correct: false }, + ], + }, + { + title: 'What does "git branch" show you?', + name: 'question6', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git conflict?', + name: 'question7', + points: 2, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A disagreement between team members', is_correct: false }, + { label: 'A merge conflict when merging branches', is_correct: true }, + { label: 'A Git error message', is_correct: false }, + ], + }, + { + title: 'How do you delete a Git branch?', + name: 'question8', + points: 2, + order: 8, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git delete branch-name', is_correct: false }, + { label: 'git remove branch-name', is_correct: false }, + { label: 'git branch -d branch-name', is_correct: true }, + { label: 'git checkout branch-name', is_correct: false }, + ], + }, + { + title: 'Explain the Git conflict resolution process.', + name: 'question9', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of "git log" in relation to branches?', + name: 'question10', + points: 2, + order: 10, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'To view a list of available branches', is_correct: false }, + { label: 'To view the commit history of a branch', is_correct: true }, + { label: 'To create a new branch', is_correct: false }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/007_git_pull.ts b/src/lib/mocks/git/007_git_pull.ts new file mode 100644 index 00000000..da31cc81 --- /dev/null +++ b/src/lib/mocks/git/007_git_pull.ts @@ -0,0 +1,125 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Pull from Remote Quiz', + description: 'Test your knowledge of Git pull operations from a remote repository', + questionnaire: { + questions: [ + { + title: 'What is Git pull used for?', + name: 'question1', + points: 2, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'To push changes to a remote repository', is_correct: false }, + { label: 'To fetch changes from a remote repository and merge them into the current branch', is_correct: true }, + { label: 'To delete a remote repository', is_correct: false }, + ], + }, + { + title: 'How do you perform a Git pull from a remote repository?', + name: 'question2', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git pull origin branch-name', is_correct: true }, + { label: 'git push origin branch-name', is_correct: false }, + { label: 'git fetch origin branch-name', is_correct: false }, + { label: 'git merge origin branch-name', is_correct: false }, + ], + }, + { + title: 'Explain the purpose of Git pull in your own words.', + name: 'question3', + points: 2, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a remote repository in Git?', + name: 'question4', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A local copy of a repository', is_correct: false }, + { label: 'A repository hosted on a remote server', is_correct: true }, + { label: 'A repository with no internet connection', is_correct: false }, + ], + }, + { + title: 'How do you specify the remote repository and branch when pulling changes in Git?', + name: 'question5', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'By using "git pull origin branch-name"', is_correct: true }, + { label: 'By using "git pull branch-name"', is_correct: false }, + { label: 'By using "git pull remote-name branch-name"', is_correct: false }, + { label: 'By using "git pull"', is_correct: false }, + ], + }, + { + title: 'What does "git fetch" do?', + name: 'question6', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git conflict?', + name: 'question7', + points: 2, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A disagreement between team members', is_correct: false }, + { label: 'A merge conflict when merging branches', is_correct: true }, + { label: 'A Git error message', is_correct: false }, + ], + }, + { + title: 'What is the purpose of "git log" in relation to Git pull?', + name: 'question8', + points: 2, + order: 8, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To view the commit history of the remote repository', is_correct: false }, + { label: 'To view the commit history of the local repository', is_correct: true }, + { label: 'To delete the commit history', is_correct: false }, + { label: 'To create a new branch', is_correct: false }, + ], + }, + { + title: 'Explain the Git conflict resolution process.', + name: 'question9', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git pull request?', + name: 'question10', + points: 2, + order: 10, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A request to delete a branch', is_correct: false }, + { label: 'A request to merge changes into a branch', is_correct: true }, + { label: 'A request for technical support', is_correct: false }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/008_git_push.ts b/src/lib/mocks/git/008_git_push.ts new file mode 100644 index 00000000..8b1bbd08 --- /dev/null +++ b/src/lib/mocks/git/008_git_push.ts @@ -0,0 +1,125 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Push to Remote Quiz', + description: 'Test your knowledge of Git push operations to a remote repository', + questionnaire: { + questions: [ + { + title: 'What is Git push used for?', + name: 'question1', + points: 2, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'To fetch changes from a remote repository', is_correct: false }, + { label: 'To send changes to a remote repository', is_correct: true }, + { label: 'To delete a remote repository', is_correct: false }, + ], + }, + { + title: 'How do you perform a Git push to a remote repository?', + name: 'question2', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git push origin branch-name', is_correct: true }, + { label: 'git pull origin branch-name', is_correct: false }, + { label: 'git fetch origin branch-name', is_correct: false }, + { label: 'git merge origin branch-name', is_correct: false }, + ], + }, + { + title: 'Explain the purpose of Git push in your own words.', + name: 'question3', + points: 2, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a remote repository in Git?', + name: 'question4', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A local copy of a repository', is_correct: false }, + { label: 'A repository hosted on a remote server', is_correct: true }, + { label: 'A repository with no internet connection', is_correct: false }, + ], + }, + { + title: 'How do you specify the remote repository and branch when pushing changes in Git?', + name: 'question5', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'By using "git push origin branch-name"', is_correct: true }, + { label: 'By using "git push branch-name"', is_correct: false }, + { label: 'By using "git push remote-name branch-name"', is_correct: false }, + { label: 'By using "git push"', is_correct: false }, + ], + }, + { + title: 'What does "git pull" do?', + name: 'question6', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git conflict?', + name: 'question7', + points: 2, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A disagreement between team members', is_correct: false }, + { label: 'A merge conflict when merging branches', is_correct: true }, + { label: 'A Git error message', is_correct: false }, + ], + }, + { + title: 'What is the purpose of "git log" in relation to Git push?', + name: 'question8', + points: 2, + order: 8, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To view the commit history of the remote repository', is_correct: false }, + { label: 'To view the commit history of the local repository', is_correct: true }, + { label: 'To delete the commit history', is_correct: false }, + { label: 'To create a new branch', is_correct: false }, + ], + }, + { + title: 'Explain the Git conflict resolution process.', + name: 'question9', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git push request?', + name: 'question10', + points: 2, + order: 10, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A request to fetch changes from a remote repository', is_correct: false }, + { label: 'A request to send changes to a remote repository', is_correct: true }, + { label: 'A request for technical support', is_correct: false }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/009_git_githubBranch.ts b/src/lib/mocks/git/009_git_githubBranch.ts new file mode 100644 index 00000000..1f8327cf --- /dev/null +++ b/src/lib/mocks/git/009_git_githubBranch.ts @@ -0,0 +1,125 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Remote Branch Quiz', + description: 'Test your knowledge of Git remote branches', + questionnaire: { + questions: [ + { + title: 'What is a Git remote branch?', + name: 'question1', + points: 2, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A branch on your local machine', is_correct: false }, + { label: 'A branch on a remote repository', is_correct: true }, + { label: 'A branch with no commits', is_correct: false }, + ], + }, + { + title: 'How do you list remote branches in Git?', + name: 'question2', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git branch', is_correct: false }, + { label: 'git remote show origin', is_correct: false }, + { label: 'git branch -r', is_correct: true }, + { label: 'git remote -v', is_correct: false }, + ], + }, + { + title: 'Explain the purpose of Git remote branches in your own words.', + name: 'question3', + points: 2, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How do you create a new remote branch in Git?', + name: 'question4', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'git branch new-branch', is_correct: false }, + { label: 'git checkout -b new-branch', is_correct: false }, + { label: 'git push origin new-branch', is_correct: true }, + ], + }, + { + title: 'How do you switch to a remote branch in Git?', + name: 'question5', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git checkout branch-name', is_correct: false }, + { label: 'git checkout -b branch-name', is_correct: false }, + { label: 'git checkout origin/branch-name', is_correct: true }, + { label: 'git switch branch-name', is_correct: false }, + ], + }, + { + title: 'What does "git push" do?', + name: 'question6', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git conflict?', + name: 'question7', + points: 2, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A disagreement between team members', is_correct: false }, + { label: 'A merge conflict when merging branches', is_correct: true }, + { label: 'A Git error message', is_correct: false }, + ], + }, + { + title: 'How do you delete a remote branch in Git?', + name: 'question8', + points: 2, + order: 8, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git delete remote branch-name', is_correct: false }, + { label: 'git push origin --delete branch-name', is_correct: true }, + { label: 'git remove remote branch-name', is_correct: false }, + { label: 'git branch -d branch-name', is_correct: false }, + ], + }, + { + title: 'Explain the Git conflict resolution process.', + name: 'question9', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git pull request?', + name: 'question10', + points: 2, + order: 10, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A request to delete a branch', is_correct: false }, + { label: 'A request to merge changes into a branch', is_correct: true }, + { label: 'A request for technical support', is_correct: false }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/010_git_branchPull.ts b/src/lib/mocks/git/010_git_branchPull.ts new file mode 100644 index 00000000..6f3ea1a8 --- /dev/null +++ b/src/lib/mocks/git/010_git_branchPull.ts @@ -0,0 +1,125 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Branch Pull from Remote Quiz', + description: 'Test your knowledge of Git branch pull operations from a remote repository', + questionnaire: { + questions: [ + { + title: 'What is Git branch pull used for?', + name: 'question1', + points: 2, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'To push changes to a remote branch', is_correct: false }, + { label: 'To fetch changes from a remote branch and merge them into the current branch', is_correct: true }, + { label: 'To delete a remote branch', is_correct: false }, + ], + }, + { + title: 'How do you perform a Git branch pull from a remote repository?', + name: 'question2', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'git pull origin branch-name', is_correct: true }, + { label: 'git push origin branch-name', is_correct: false }, + { label: 'git fetch origin branch-name', is_correct: false }, + { label: 'git merge origin branch-name', is_correct: false }, + ], + }, + { + title: 'Explain the purpose of Git branch pull in your own words.', + name: 'question3', + points: 2, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a remote branch in Git?', + name: 'question4', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A branch on your local machine', is_correct: false }, + { label: 'A branch on a remote repository', is_correct: true }, + { label: 'A branch with no commits', is_correct: false }, + ], + }, + { + title: 'How do you specify the remote repository and branch when pulling changes in Git?', + name: 'question5', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'By using "git pull origin branch-name"', is_correct: true }, + { label: 'By using "git pull branch-name"', is_correct: false }, + { label: 'By using "git pull remote-name branch-name"', is_correct: false }, + { label: 'By using "git pull"', is_correct: false }, + ], + }, + { + title: 'What does "git fetch" do?', + name: 'question6', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git conflict?', + name: 'question7', + points: 2, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A disagreement between team members', is_correct: false }, + { label: 'A merge conflict when merging branches', is_correct: true }, + { label: 'A Git error message', is_correct: false }, + ], + }, + { + title: 'What is the purpose of "git log" in relation to Git branch pull?', + name: 'question8', + points: 2, + order: 8, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'To view the commit history of the remote branch', is_correct: false }, + { label: 'To view the commit history of the local branch', is_correct: true }, + { label: 'To delete the commit history', is_correct: false }, + { label: 'To create a new branch', is_correct: false }, + ], + }, + { + title: 'Explain the Git conflict resolution process.', + name: 'question9', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a Git branch pull request?', + name: 'question10', + points: 2, + order: 10, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'A request to delete a branch', is_correct: false }, + { label: 'A request to merge changes into a branch', is_correct: true }, + { label: 'A request for technical support', is_correct: false }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/011_git_branchPush.ts b/src/lib/mocks/git/011_git_branchPush.ts new file mode 100644 index 00000000..e27f7b3c --- /dev/null +++ b/src/lib/mocks/git/011_git_branchPush.ts @@ -0,0 +1,213 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Branch Push to Remote Quiz', + description: 'Test your knowledge of Git branch pushing to remote repositories.', + questionnaire: { + questions: [ + { + title: 'How do you push a new branch to a remote repository in Git?', + name: 'q1', + points: 2, + order: 1, + question_type: QuestionTypes[0], + options: [ + { + label: 'git push origin new-branch', + is_correct: true, + }, + { + label: 'git branch -b new-branch', + is_correct: false, + }, + { + label: 'git pull origin new-branch', + is_correct: false, + }, + ], + }, + { + title: 'What does "git push --force" do?', + name: 'q2', + points: 2, + order: 2, + question_type: QuestionTypes[1], + options: [ + { + label: 'Force pushes all local branches', + is_correct: false, + }, + { + label: 'Force pushes the current branch to remote', + is_correct: true, + }, + { + label: 'Deletes the remote repository', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of "origin" in "git push origin"?', + name: 'q3', + points: 2, + order: 3, + question_type: QuestionTypes[2], + options: [ + { + label: 'It specifies the local branch', + is_correct: false, + }, + { + label: 'It refers to the remote repository', + is_correct: true, + }, + { + label: 'It is not required in "git push"', + is_correct: false, + }, + ], + }, + { + title: 'How do you check the status of your Git repository?', + name: 'q1', + points: 1, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'git status', + is_correct: true, + }, + { + label: 'git log', + is_correct: false, + }, + { + label: 'git commit', + is_correct: false, + }, + ], + }, + { + title: 'What command is used to create a new branch in Git?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'git branch ', + is_correct: true, + }, + { + label: 'git checkout -b ', + is_correct: false, + }, + { + label: 'git create ', + is_correct: false, + }, + ], + }, + { + title: 'How do you stage changes for a commit in Git?', + name: 'q3', + points: 1, + order: 2, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'git add ', + is_correct: true, + }, + { + label: 'git commit -m "Message"', + is_correct: false, + }, + { + label: 'git push', + is_correct: false, + }, + ], + }, + { + title: 'Which command is used to remove a file from the staging area in Git?', + name: 'q4', + points: 1, + order: 3, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { + label: 'git reset', + is_correct: true, + }, + { + label: 'git rm', + is_correct: true, + }, + { + label: 'git commit', + is_correct: false, + }, + ], + }, + { + title: 'How do you create a Git tag for a specific commit?', + name: 'q6', + points: 1, + order: 5, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'git tag -a ', + is_correct: true, + }, + { + label: 'git branch -t ', + is_correct: false, + }, + { + label: 'git commit -m "Tag: "', + is_correct: false, + }, + ], + }, + { + title: 'How do you discard changes in your working directory in Git?', + name: 'q8', + points: 1, + order: 7, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { + label: 'git reset --hard', + is_correct: true, + }, + { + label: 'git checkout -- ', + is_correct: true, + }, + { + label: 'git commit -m "Discard changes"', + is_correct: false, + }, + ], + }, + + { + title: 'Explain the difference between "git merge" and "git rebase".', + name: 'q10', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/012_git_githubFlow.ts b/src/lib/mocks/git/012_git_githubFlow.ts new file mode 100644 index 00000000..cca37d09 --- /dev/null +++ b/src/lib/mocks/git/012_git_githubFlow.ts @@ -0,0 +1,198 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git/GitHub Flow Quiz', + description: 'Test your knowledge of Git and GitHub Flow with practical questions.', + questionnaire: { + questions: [ + { + title: 'What is the purpose of a "Pull Request" in GitHub Flow?', + name: 'q1', + points: 2, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To propose and discuss changes before merging them', + is_correct: true, + }, + { + label: 'To create a new branch', + is_correct: false, + }, + { + label: 'To submit a bug report', + is_correct: false, + }, + ], + }, + { + title: 'How do you create a new branch in Git?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'git checkout -b ', + is_correct: true, + }, + { + label: 'git commit -m "New branch"', + is_correct: false, + }, + { + label: 'git merge ', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of the "git merge" command?', + name: 'q3', + points: 2, + order: 2, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To combine changes from one branch into another', + is_correct: true, + }, + { + label: 'To delete a branch', + is_correct: false, + }, + { + label: 'To create a new branch', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of "Forking" a repository in GitHub.', + name: 'q4', + points: 3, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How do you resolve a merge conflict in Git?', + name: 'q5', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By manually editing the conflicting files and committing the changes', + is_correct: true, + }, + { + label: 'By deleting the conflicting branch', + is_correct: false, + }, + { + label: 'By rolling back to the previous commit', + is_correct: false, + }, + ], + }, + { + title: 'Which Git command is used to view the commit history?', + name: 'q6', + points: 1, + order: 5, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'git log', + is_correct: true, + }, + { + label: 'git branch', + is_correct: false, + }, + { + label: 'git pull', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of a "Gitignore" file?', + name: 'q7', + points: 1, + order: 6, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To specify files and directories that should be ignored by Git', + is_correct: true, + }, + { + label: 'To track all files in the repository', + is_correct: false, + }, + { + label: 'To create a new branch', + is_correct: false, + }, + ], + }, + { + title: 'Which Git command is used to push changes to a remote repository?', + name: 'q8', + points: 1, + order: 7, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { + label: 'git push origin master', + is_correct: true, + }, + { + label: 'git commit -m "Push changes"', + is_correct: false, + }, + { + label: 'git fetch origin', + is_correct: true, + }, + ], + }, + { + title: 'What is a "Git branch"?', + name: 'q9', + points: 1, + order: 8, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'A separate line of development in a Git repository', + is_correct: true, + }, + { + label: 'A software development framework', + is_correct: false, + }, + { + label: 'A Git commit message', + is_correct: false, + }, + ], + }, + { + title: 'Explain the difference between "git pull" and "git fetch".', + name: 'q10', + points: 3, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/013_git_githubPages.ts b/src/lib/mocks/git/013_git_githubPages.ts new file mode 100644 index 00000000..b0dfd92e --- /dev/null +++ b/src/lib/mocks/git/013_git_githubPages.ts @@ -0,0 +1,198 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'GitHub Pages Quiz', + description: 'Test your knowledge of GitHub Pages with practical questions.', + questionnaire: { + questions: [ + { + title: 'What is the purpose of GitHub Pages?', + name: 'q1', + points: 1, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To host and publish static web content', + is_correct: true, + }, + { + label: 'To manage Git repositories', + is_correct: false, + }, + { + label: 'To create mobile apps', + is_correct: false, + }, + ], + }, + { + title: 'How can you enable GitHub Pages for a repository?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'In the repository settings, under "GitHub Pages"', + is_correct: true, + }, + { + label: 'By creating a new branch', + is_correct: false, + }, + { + label: 'By merging a pull request', + is_correct: false, + }, + ], + }, + { + title: 'What is the default URL for a GitHub Pages site?', + name: 'q3', + points: 1, + order: 2, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'https://username.github.io/repository-name/', + is_correct: true, + }, + { + label: 'https://github.com/username/repository-name/', + is_correct: false, + }, + { + label: 'https://repository-name.github.io/username/', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of a "custom domain" for GitHub Pages.', + name: 'q4', + points: 3, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How do you configure a custom domain for a GitHub Pages site?', + name: 'q5', + points: 2, + order: 4, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { + label: 'Update DNS records with your domain registrar', + is_correct: true, + }, + { + label: 'Add a CNAME file to your repository', + is_correct: true, + }, + { + label: 'Modify the GitHub Pages settings in your repository', + is_correct: true, + }, + ], + }, + { + title: 'What is the purpose of a "404.html" file in a GitHub Pages repository?', + name: 'q6', + points: 1, + order: 5, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To customize the error page for "Page Not Found"', + is_correct: true, + }, + { + label: 'To store images and assets', + is_correct: false, + }, + { + label: 'To create a new branch', + is_correct: false, + }, + ], + }, + { + title: 'How can you enforce HTTPS on a GitHub Pages site?', + name: 'q7', + points: 2, + order: 6, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { + label: 'Enable the "Enforce HTTPS" option in repository settings', + is_correct: true, + }, + { + label: 'Use a custom SSL certificate', + is_correct: true, + }, + { + label: 'Install a GitHub Pages plugin', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of a "gh-pages" branch in a GitHub repository?', + name: 'q8', + points: 1, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To host the GitHub Pages site content', + is_correct: true, + }, + { + label: 'To store code backups', + is_correct: false, + }, + { + label: 'To track issues and pull requests', + is_correct: false, + }, + ], + }, + { + title: 'What is Jekyll in the context of GitHub Pages?', + name: 'q9', + points: 2, + order: 8, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How can you access the GitHub Pages deployment history?', + name: 'q10', + points: 1, + order: 9, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'In the GitHub Actions tab of the repository', + is_correct: true, + }, + { + label: 'By running a Git command', + is_correct: false, + }, + { + label: 'In the repository settings', + is_correct: false, + }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/014_git_githubFork.ts b/src/lib/mocks/git/014_git_githubFork.ts new file mode 100644 index 00000000..6cc645cd --- /dev/null +++ b/src/lib/mocks/git/014_git_githubFork.ts @@ -0,0 +1,198 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Remote and Forking Quiz', + description: 'Test your knowledge of Git Remote and Forking with practical questions.', + questionnaire: { + questions: [ + { + title: 'What does it mean to "fork" a GitHub repository?', + name: 'q1', + points: 2, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To create a personal copy of someone else\'s repository', + is_correct: true, + }, + { + label: 'To merge multiple branches', + is_correct: false, + }, + { + label: 'To delete a repository', + is_correct: false, + }, + ], + }, + { + title: 'How do you create a fork of a GitHub repository?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'Click the "Fork" button on the repository page', + is_correct: true, + }, + { + label: 'Use the "git fork" command', + is_correct: false, + }, + { + label: 'Ask the repository owner to send you a copy', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of a "remote" in Git?', + name: 'q3', + points: 1, + order: 2, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To represent a connection to a remote repository', + is_correct: true, + }, + { + label: 'To manage local branches', + is_correct: false, + }, + { + label: 'To store code backups', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of a "pull request" in the context of forking a repository.', + name: 'q4', + points: 3, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How do you keep a forked repository up to date with changes from the original repository?', + name: 'q5', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By creating a pull request', + is_correct: false, + }, + { + label: 'By configuring a remote named "upstream" and fetching updates', + is_correct: true, + }, + { + label: 'By deleting the fork and re-forking the repository', + is_correct: false, + }, + ], + }, + { + title: 'What is a "merge conflict" in Git?', + name: 'q6', + points: 1, + order: 5, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'A situation where Git cannot automatically merge changes', + is_correct: true, + }, + { + label: 'A conflict between team members', + is_correct: false, + }, + { + label: 'A bug in the Git software', + is_correct: false, + }, + ], + }, + { + title: 'How can you resolve a merge conflict in Git?', + name: 'q7', + points: 2, + order: 6, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { + label: 'Manually edit the conflicting files and commit the changes', + is_correct: true, + }, + { + label: 'Choose one version and discard the other', + is_correct: true, + }, + { + label: 'Ask the repository owner to resolve it', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of the "git remote -v" command?', + name: 'q8', + points: 1, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To view the URLs of remote repositories', + is_correct: true, + }, + { + label: 'To create a new remote repository', + is_correct: false, + }, + { + label: 'To list local branches', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of a "forking workflow" in Git.', + name: 'q9', + points: 3, + order: 8, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How do you contribute changes from a forked repository back to the original repository?', + name: 'q10', + points: 2, + order: 9, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By creating a pull request from your fork to the original repository', + is_correct: true, + }, + { + label: 'By copying and pasting the code into the original repository', + is_correct: false, + }, + { + label: 'By sending an email to the repository owner', + is_correct: false, + }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/015_git_clone.ts b/src/lib/mocks/git/015_git_clone.ts new file mode 100644 index 00000000..1bcce59b --- /dev/null +++ b/src/lib/mocks/git/015_git_clone.ts @@ -0,0 +1,198 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Clone Quiz', + description: 'Test your knowledge of Git Clone with practical questions.', + questionnaire: { + questions: [ + { + title: 'What is the purpose of the "git clone" command?', + name: 'q1', + points: 2, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To create a copy of a remote repository on your local machine', + is_correct: true, + }, + { + label: 'To delete a Git repository', + is_correct: false, + }, + { + label: 'To merge branches', + is_correct: false, + }, + ], + }, + { + title: 'How do you clone a Git repository from a specific branch?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'git clone -b ', + is_correct: true, + }, + { + label: 'git branch -t ', + is_correct: false, + }, + { + label: 'git pull origin ', + is_correct: false, + }, + ], + }, + { + title: 'What is the default name of the directory where "git clone" creates a local copy of the repository?', + name: 'q3', + points: 1, + order: 2, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'The same as the repository name', + is_correct: true, + }, + { + label: 'LocalGitRepo', + is_correct: false, + }, + { + label: 'CloneRepo', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of a "bare" Git repository.', + name: 'q4', + points: 3, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of the "git clone --depth" option?', + name: 'q5', + points: 2, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To limit the clone to a specified number of commits deep', + is_correct: true, + }, + { + label: 'To create a shallow clone of a repository', + is_correct: false, + }, + { + label: 'To clone only the latest commit', + is_correct: false, + }, + ], + }, + { + title: 'How can you clone a Git repository without downloading the commit history?', + name: 'q6', + points: 1, + order: 5, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'Using the "git clone --depth 1" command', + is_correct: true, + }, + { + label: 'It is not possible to clone without history', + is_correct: false, + }, + { + label: 'Using the "git clone --shallow" command', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of the "git clone --recurse-submodules" option?', + name: 'q7', + points: 2, + order: 6, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To clone and initialize submodules within the repository', + is_correct: true, + }, + { + label: 'To create a shallow clone of submodules', + is_correct: false, + }, + { + label: 'To clone only the parent repository, excluding submodules', + is_correct: false, + }, + ], + }, + { + title: 'How can you clone a repository from a specific commit?', + name: 'q8', + points: 1, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By specifying the commit hash after the repository URL', + is_correct: true, + }, + { + label: 'By using the "git clone --commit" command', + is_correct: false, + }, + { + label: 'It is not possible to clone from a specific commit', + is_correct: false, + }, + ], + }, + { + title: 'Explain the purpose of the "git submodule" command in a Git repository.', + name: 'q9', + points: 3, + order: 8, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the main difference between "git clone" and "git pull"?', + name: 'q10', + points: 2, + order: 9, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'git clone creates a new copy, while git pull updates an existing copy', + is_correct: true, + }, + { + label: 'git clone creates a copy of the entire repository history, while git pull only gets the latest changes', + is_correct: false, + }, + { + label: 'git clone is used for cloning remote repositories, while git pull is used for local repositories', + is_correct: false, + }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/016_git_pullRequest.ts b/src/lib/mocks/git/016_git_pullRequest.ts new file mode 100644 index 00000000..fb9eff33 --- /dev/null +++ b/src/lib/mocks/git/016_git_pullRequest.ts @@ -0,0 +1,202 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Remote Pull Request Quiz', + description: 'Test your knowledge of sending pull requests with Git remote with practical questions.', + questionnaire: { + questions: [ + { + title: 'What is the purpose of sending a pull request in Git?', + name: 'q1', + points: 2, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To propose changes to a repository and request that they be merged', + is_correct: true, + }, + { + label: 'To create a new branch in the repository', + is_correct: false, + }, + { + label: 'To delete a Git repository', + is_correct: false, + }, + ], + }, + { + title: 'How do you send a pull request to a remote repository?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By pushing your changes to a branch and creating a pull request on the repository platform', + is_correct: true, + }, + { + label: 'By sending an email to the repository owner', + is_correct: false, + }, + { + label: 'By using the "git send-request" command', + is_correct: false, + }, + ], + }, + { + title: 'What information should be included in a pull request?', + name: 'q3', + points: 2, + order: 2, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { + label: 'A description of the changes', + is_correct: true, + }, + { + label: 'The branch you want to merge into', + is_correct: true, + }, + { + label: 'Your email address', + is_correct: false, + }, + { + label: 'A screenshot of the code changes', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of a "base branch" in the context of a pull request.', + name: 'q4', + points: 3, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of reviewing and commenting on a pull request?', + name: 'q5', + points: 1, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To provide feedback on the proposed changes', + is_correct: true, + }, + { + label: 'To create a new branch in the repository', + is_correct: false, + }, + { + label: 'To merge the changes immediately', + is_correct: false, + }, + ], + }, + { + title: 'How can you indicate that you approve of a pull request?', + name: 'q6', + points: 1, + order: 5, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By leaving a comment with an approving message', + is_correct: true, + }, + { + label: 'By sending a direct message to the repository owner', + is_correct: false, + }, + { + label: 'By clicking a "Submit Approval" button', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of continuous integration (CI) checks in a pull request?', + name: 'q7', + points: 2, + order: 6, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To automatically test and verify the proposed changes', + is_correct: true, + }, + { + label: 'To display advertising on the pull request page', + is_correct: false, + }, + { + label: 'To increase the number of comments on the pull request', + is_correct: false, + }, + ], + }, + { + title: 'What happens after a pull request is approved and passes all checks?', + name: 'q8', + points: 1, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'The changes are merged into the base branch', + is_correct: true, + }, + { + label: 'The pull request is automatically closed', + is_correct: false, + }, + { + label: 'The changes are rejected', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of a "conflict" in the context of a pull request.', + name: 'q9', + points: 3, + order: 8, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How can you track the status of a pull request?', + name: 'q10', + points: 2, + order: 9, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By visiting the pull request page on the repository platform', + is_correct: true, + }, + { + label: 'By using the "git status" command', + is_correct: false, + }, + { + label: 'By sending an email to the repository owner', + is_correct: false, + }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/017_git_ignore.ts b/src/lib/mocks/git/017_git_ignore.ts new file mode 100644 index 00000000..20f337fd --- /dev/null +++ b/src/lib/mocks/git/017_git_ignore.ts @@ -0,0 +1,198 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Ignore Quiz', + description: 'Test your knowledge of .gitignore with practical questions.', + questionnaire: { + questions: [ + { + title: 'What is the purpose of the .gitignore file in a Git repository?', + name: 'q1', + points: 2, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To specify which files and directories should be excluded from version control', + is_correct: true, + }, + { + label: 'To store sensitive information like passwords', + is_correct: false, + }, + { + label: 'To track changes in the .gitignore file itself', + is_correct: false, + }, + ], + }, + { + title: 'How can you create a .gitignore file in your Git repository?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By manually creating a file named .gitignore', + is_correct: true, + }, + { + label: 'By using the "git ignore" command', + is_correct: false, + }, + { + label: 'The .gitignore file is automatically generated by Git', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of the "*" wildcard in a .gitignore pattern?', + name: 'q3', + points: 2, + order: 2, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To match zero or more characters', + is_correct: true, + }, + { + label: 'To match exactly one character', + is_correct: false, + }, + { + label: 'To match a specific file name', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of a "global" .gitignore file.', + name: 'q4', + points: 3, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What happens if you add a file to the .gitignore list after it has been committed to the repository?', + name: 'q5', + points: 1, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'The file will continue to be tracked by Git', + is_correct: false, + }, + { + label: 'The file will be untracked in future commits', + is_correct: true, + }, + { + label: 'The file will be deleted from the repository', + is_correct: false, + }, + ], + }, + { + title: 'How can you check which files are being ignored by Git in a repository?', + name: 'q6', + points: 1, + order: 5, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By using the "git ignored" command', + is_correct: false, + }, + { + label: 'By inspecting the .gitignore file', + is_correct: false, + }, + { + label: 'By using the "git status" command', + is_correct: true, + }, + ], + }, + { + title: 'What is the purpose of the ".gitignore" file located in your home directory?', + name: 'q7', + points: 2, + order: 6, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To specify global Git ignore patterns for all repositories', + is_correct: true, + }, + { + label: 'To store personal Git configuration settings', + is_correct: false, + }, + { + label: 'To list your favorite Git repositories', + is_correct: false, + }, + ], + }, + { + title: 'How can you force Git to track files that are listed in the .gitignore file?', + name: 'q8', + points: 1, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By using the "git add --force" command', + is_correct: false, + }, + { + label: 'By removing the file from the .gitignore list and committing the change', + is_correct: true, + }, + { + label: 'It is not possible to track ignored files', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of a ".gitignore" template.', + name: 'q9', + points: 3, + order: 8, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of the ".git/info/exclude" file in a Git repository?', + name: 'q10', + points: 2, + order: 9, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To specify repository-specific ignore patterns', + is_correct: true, + }, + { + label: 'To store repository metadata', + is_correct: false, + }, + { + label: 'To list contributors to the repository', + is_correct: false, + }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/018_gitSsh.ts b/src/lib/mocks/git/018_gitSsh.ts new file mode 100644 index 00000000..0ae3ff1c --- /dev/null +++ b/src/lib/mocks/git/018_gitSsh.ts @@ -0,0 +1,185 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Security and SSH Quiz', + description: 'Test your knowledge of Git security and SSH with practical questions.', + questionnaire: { + questions: [ + { + title: 'What is the primary purpose of using SSH keys with Git?', + name: 'q1', + points: 2, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To securely authenticate and communicate with remote Git repositories', + is_correct: true, + }, + { + label: 'To store sensitive information in Git repositories', + is_correct: false, + }, + { + label: 'To track changes in SSH keys', + is_correct: false, + }, + ], + }, + { + title: 'How can you generate a new SSH key pair?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By using the "ssh-keygen" command', + is_correct: true, + }, + { + label: 'By sending a request to the Git repository hosting service', + is_correct: false, + }, + { + label: 'SSH keys cannot be generated manually', + is_correct: false, + }, + ], + }, + { + title: 'Explain the difference between a public SSH key and a private SSH key.', + name: 'q3', + points: 2, + order: 2, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of adding your SSH public key to your Git hosting service?', + name: 'q4', + points: 3, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How can you configure Git to use an SSH key for authentication?', + name: 'q5', + points: 1, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By adding the SSH key to your SSH agent and configuring Git to use it', + is_correct: true, + }, + { + label: 'By including the SSH key in your Git repository', + is_correct: false, + }, + { + label: 'By manually entering the SSH key every time you push or pull', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of SSH key passphrase?', + name: 'q6', + points: 1, + order: 5, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To add an extra layer of security to your SSH key', + is_correct: true, + }, + { + label: 'To store the SSH key on the Git hosting service', + is_correct: false, + }, + { + label: 'To generate a new SSH key pair', + is_correct: false, + }, + ], + }, + { + title: 'What should you do if you lose your SSH private key?', + name: 'q7', + points: 2, + order: 6, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'Generate a new SSH key pair and update your Git hosting service with the new public key', + is_correct: true, + }, + { + label: 'There is no way to recover from a lost SSH private key', + is_correct: false, + }, + { + label: 'Contact your Git hosting service to reset your password', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of two-factor authentication (2FA) in SSH.', + name: 'q8', + points: 3, + order: 7, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of SSH key fingerprints?', + name: 'q9', + points: 1, + order: 8, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To verify the authenticity of an SSH key', + is_correct: true, + }, + { + label: 'To encrypt SSH key data', + is_correct: false, + }, + { + label: 'To increase the length of an SSH key', + is_correct: false, + }, + ], + }, + { + title: 'How can you check if your SSH key is properly configured in Git?', + name: 'q10', + points: 2, + order: 9, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By using the "ssh -T" command to test authentication with your Git hosting service', + is_correct: true, + }, + { + label: 'By checking the ".ssh" directory in your home directory', + is_correct: false, + }, + { + label: 'There is no way to verify SSH key configuration in Git', + is_correct: false, + }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/019_git_revert.ts b/src/lib/mocks/git/019_git_revert.ts new file mode 100644 index 00000000..7e19ad89 --- /dev/null +++ b/src/lib/mocks/git/019_git_revert.ts @@ -0,0 +1,185 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Revert Quiz', + description: 'Test your knowledge of Git revert with practical questions.', + questionnaire: { + questions: [ + { + title: 'What is the purpose of the "git revert" command in Git?', + name: 'q1', + points: 2, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To create a new branch in the repository', + is_correct: false, + }, + { + label: 'To undo a previous commit by creating a new commit', + is_correct: true, + }, + { + label: 'To delete a Git repository', + is_correct: false, + }, + ], + }, + { + title: 'How can you revert a specific commit in Git?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By using the "git revert" command followed by the commit hash', + is_correct: true, + }, + { + label: 'By deleting the commit from the commit history', + is_correct: false, + }, + { + label: 'By creating a new branch and manually reverting changes', + is_correct: false, + }, + ], + }, + { + title: 'Explain the difference between "git revert" and "git reset" commands.', + name: 'q3', + points: 2, + order: 2, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is a potential drawback of using "git revert" to undo commits?', + name: 'q4', + points: 3, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How can you revert multiple consecutive commits in Git?', + name: 'q5', + points: 1, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By running "git revert" multiple times for each commit', + is_correct: true, + }, + { + label: 'By creating a new branch and deleting the unwanted commits', + is_correct: false, + }, + { + label: 'It is not possible to revert multiple commits at once', + is_correct: false, + }, + ], + }, + { + title: 'What is a "revert commit" in Git?', + name: 'q6', + points: 1, + order: 5, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'A new commit that undoes the changes introduced by a previous commit', + is_correct: true, + }, + { + label: 'A commit that creates a new branch', + is_correct: false, + }, + { + label: 'A commit with no changes', + is_correct: false, + }, + ], + }, + { + title: 'How can you preview the changes that will be made by a "git revert" operation?', + name: 'q7', + points: 2, + order: 6, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By using the "git diff" command with the commit hash', + is_correct: true, + }, + { + label: 'By using the "git show" command with the commit hash', + is_correct: false, + }, + { + label: 'It is not possible to preview changes before reverting', + is_correct: false, + }, + ], + }, + { + title: 'What happens to the commit history after a "git revert" operation?', + name: 'q8', + points: 1, + order: 7, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'A new commit is added to undo the changes, preserving the commit history', + is_correct: true, + }, + { + label: 'The commit history is deleted', + is_correct: false, + }, + { + label: 'The commit is marked as "reverted" without adding a new commit', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of a "conflict" when reverting changes in Git.', + name: 'q9', + points: 3, + order: 8, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of the "git revert -n" command?', + name: 'q10', + points: 2, + order: 9, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To revert a commit without creating a new commit', + is_correct: true, + }, + { + label: 'To revert a commit and delete the commit history', + is_correct: false, + }, + { + label: 'To revert a commit and force push it to the remote repository', + is_correct: false, + }, + ], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/020_git_reset.ts b/src/lib/mocks/git/020_git_reset.ts new file mode 100644 index 00000000..f71f8207 --- /dev/null +++ b/src/lib/mocks/git/020_git_reset.ts @@ -0,0 +1,159 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'Git Reset Quiz', + description: 'Test your knowledge of Git reset with practical questions.', + questionnaire: { + questions: [ + { + title: 'What is the purpose of the "git reset" command in Git?', + name: 'q1', + points: 2, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To create a new branch in the repository', + is_correct: false, + }, + { + label: 'To remove changes from the staging area and uncommit them', + is_correct: true, + }, + { + label: 'To delete a Git repository', + is_correct: false, + }, + ], + }, + { + title: 'What are the different modes of "git reset"?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How does "git reset" differ from "git revert"?', + name: 'q3', + points: 2, + order: 2, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of the "git reset HEAD" command?', + name: 'q4', + points: 3, + order: 3, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What happens to the commit history after a "git reset" operation?', + name: 'q5', + points: 1, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'The commit history is preserved, but the branch pointer moves to a different commit', + is_correct: true, + }, + { + label: 'The commit history is deleted', + is_correct: false, + }, + { + label: 'A new branch is created', + is_correct: false, + }, + ], + }, + { + title: 'What is the purpose of "git reset --hard"?', + name: 'q6', + points: 1, + order: 5, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'To reset the branch, staging area, and working directory to a specific commit', + is_correct: true, + }, + { + label: 'To create a new branch', + is_correct: false, + }, + { + label: 'To uncommit changes without affecting the working directory', + is_correct: false, + }, + ], + }, + { + title: 'How can you unstage changes from the staging area using "git reset"?', + name: 'q7', + points: 2, + order: 6, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By running "git reset" with no additional arguments', + is_correct: true, + }, + { + label: 'By specifying the commit hash with "git reset"', + is_correct: false, + }, + { + label: 'It is not possible to unstage changes with "git reset"', + is_correct: false, + }, + ], + }, + { + title: 'What does "soft," "mixed," and "hard" mean in the context of "git reset"?', + name: 'q8', + points: 3, + order: 7, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How can you discard all changes in the working directory using "git reset"?', + name: 'q9', + points: 1, + order: 8, + question_type: QuestionTypes[0], // RADIO + options: [ + { + label: 'By using "git reset --hard HEAD"', + is_correct: true, + }, + { + label: 'By using "git reset --soft HEAD"', + is_correct: false, + }, + { + label: 'By using "git reset HEAD"', + is_correct: false, + }, + ], + }, + { + title: 'Explain the concept of the "reflog" in Git.', + name: 'q10', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/git/index.ts b/src/lib/mocks/git/index.ts new file mode 100644 index 00000000..f98e2372 --- /dev/null +++ b/src/lib/mocks/git/index.ts @@ -0,0 +1,66 @@ +import gitNewFiles from './001_git_newFiles'; +import gitStaging from './002_git_staging'; +import gitCommit from './003_git_commit'; +import gitAmend from './004_git_amend'; +import gitBranch from './005_git_branch'; +import gitBranchMerge from './006_git_branchMerge'; +import gitPull from './007_git_pull'; +import gitPush from './008_git_push'; +import gitGithubBranch from './009_git_githubBranch'; +import gitBranchPull from './010_git_branchPull'; +import gitBranchPush from './011_git_branchPush'; +import gitGithubFlow from './012_git_githubFlow'; +import gitGithubPages from './013_git_githubPages'; +import gitGithubFork from './014_git_githubFork'; +import gitClone from './015_git_clone'; +import gitPullRequest from './016_git_pullRequest'; +import gitIgnore from './017_git_ignore'; +import gitSsh from './018_gitSsh'; +import gitRevert from './019_git_revert'; +import gitReset from './020_git_reset'; + +export const GIT_IDS: { [key: string]: string } = { + GIT_NEWFILES: 'GIT_NEWFILES', + GIT_STAGING: 'GIT_STAGING', + GIT_COMMIT: 'GIT_COMMIT', + GIT_AMEND: 'GIT_AMEND', + GIT_BRANCH: 'GIT_BRANCH', + GIT_BRANCHMERGE: 'GIT_BRANCHMERGE', + GIT_PULL: 'GIT_PULL', + GIT_PUSH: 'GIT_PUSH', + GIT_GITHUBBRANCH: 'GIT_GITHUBBRANCH', + GIT_BRANCHPULL: 'GIT_BRANCHPULL', + GIT_BRANCHPUSH: 'GIT_BRANCHPUSH', + GIT_GITHUBFLOW: 'GIT_GITHUBFLOW', + GIT_GITHUBPAGES: 'GIT_GITHUBPAGES', + GIT_GITHUBFORK: 'GIT_GITHUBFORK', + GIT_CLONE: 'GIT_CLONE', + GIT_PULLREQUEST: 'GIT_PULLREQUEST', + GIT_IGNORE: 'GIT_IGNORE', + GIT_SSH: 'GIT_SSH', + GIT_REVERT: 'GIT_REVERT', + GIT_RESET: 'GIT_RESET' +}; + +export const GIT_TEMPLATES = { + [GIT_IDS.GIT_NEWFILES]: gitNewFiles, + [GIT_IDS.GIT_STAGING]: gitStaging, + [GIT_IDS.GIT_COMMIT]: gitCommit, + [GIT_IDS.GIT_AMEND]: gitAmend, + [GIT_IDS.GIT_BRANCH]: gitBranch, + [GIT_IDS.GIT_BRANCHMERGE]: gitBranchMerge, + [GIT_IDS.GIT_PULL]: gitPull, + [GIT_IDS.GIT_PUSH]: gitPush, + [GIT_IDS.GIT_GITHUBBRANCH]: gitGithubBranch, + [GIT_IDS.GIT_BRANCHPULL]: gitBranchPull, + [GIT_IDS.GIT_BRANCHPUSH]: gitBranchPush, + [GIT_IDS.GIT_GITHUBFLOW]: gitGithubFlow, + [GIT_IDS.GIT_GITHUBPAGES]: gitGithubPages, + [GIT_IDS.GIT_GITHUBFORK]: gitGithubFork, + [GIT_IDS.GIT_CLONE]: gitClone, + [GIT_IDS.GIT_PULLREQUEST]: gitPullRequest, + [GIT_IDS.GIT_IGNORE]: gitIgnore, + [GIT_IDS.GIT_SSH]: gitSsh, + [GIT_IDS.GIT_REVERT]: gitRevert, + [GIT_IDS.GIT_RESET]: gitReset, +}; diff --git a/src/lib/mocks/index.ts b/src/lib/mocks/index.ts index 872288d3..da9f664e 100644 --- a/src/lib/mocks/index.ts +++ b/src/lib/mocks/index.ts @@ -7,6 +7,7 @@ import { NODE_IDS, NODE_TEMPLATES } from './node'; import { REACT_IDS, REACT_TEMPLATES } from './react'; import { TS_IDS, TS_TEMPLATES } from './typescript'; import { PHP_IDS, PHP_TEMPLATES } from './php'; +import { GIT_IDS, GIT_TEMPLATES } from './git'; export const TAGS = { HTML: 'HTML', @@ -16,7 +17,8 @@ export const TAGS = { ReactJS: 'ReactJS', VueJS: 'VueJS', NodeJS: 'NodeJS', - PHP: 'PHP' + PHP: 'PHP', + GIT: 'GIT' }; function generateTemplateForTag( @@ -53,5 +55,6 @@ export const TEMPLATES = { [TAGS.ReactJS]: generateTemplateForTag(REACT_IDS, REACT_TEMPLATES), [TAGS.VueJS]: [], [TAGS.NodeJS]: generateTemplateForTag(NODE_IDS, NODE_TEMPLATES), - [TAGS.PHP]: generateTemplateForTag(PHP_IDS, PHP_TEMPLATES) + [TAGS.PHP]: generateTemplateForTag(PHP_IDS, PHP_TEMPLATES), + [TAGS.GIT]: generateTemplateForTag(GIT_IDS, GIT_TEMPLATES) };