├── data
├── examples
│ ├── mcq-multi-answer.md
│ ├── sort-into-boxes.md
│ ├── fib-simple.md
│ ├── mcq.md
│ ├── fill-in-the-blanks.md
│ ├── matching.md
│ ├── fib-multiple.md
│ ├── swipe-left-right.md
│ ├── mcq-2-questions.md
│ ├── fib-2.md
│ ├── fib-with-long-values.md
│ └── fib-1.md
├── question.md
└── answer.md
├── .gitignore
├── .gitmodules
├── package.json
├── public
├── styles.css
├── components
│ ├── toolbar.css
│ └── toolbar.js
├── index.html
├── modules
│ ├── sort.js
│ ├── swipe.js
│ ├── fib.css
│ ├── mcq.css
│ ├── matching.css
│ ├── fib.js
│ ├── matching.js
│ └── mcq.js
└── app.js
├── .github
└── workflows
│ └── build-release.yaml
├── README.md
├── LICENSE
├── PRD_MCQ.md
└── server.js
/data/examples/mcq-multi-answer.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | data/answer.md
3 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "public/design-system"]
2 | path = public/design-system
3 | url = https://github.com/CodeSignal/learn_bespoke-design-system.git
4 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cosmo-activities-web",
3 | "version": "1.0.0",
4 | "main": "server.js",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1",
7 | "start": "node server.js"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "description": "",
13 | "dependencies": {
14 | "marked": "^4.3.0",
15 | "ws": "^8.18.3"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/data/examples/sort-into-boxes.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Sort Into Boxes
4 |
5 | __Practice Question__
6 |
7 | Sort these people leadership behaviors into the correct dimension categories:
8 |
9 | __Labels__
10 |
11 | - First Box Label: Directive Behavior
12 | - Second Box Label: Supportive Behavior
13 |
14 | __First Box Items__
15 |
16 | - Setting expectations
17 | - Giving guidancey
18 | - Tracking progress
19 |
20 | __Second Box Items__
21 |
22 | - Active listening
23 | - Recognizing wins
24 | - Offering assistance
25 |
26 |
27 |
--------------------------------------------------------------------------------
/data/examples/fib-simple.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Fill In The Blanks
4 |
5 | __Markdown With Blanks__
6 |
7 | Fill in the blanks
8 |
9 | > This paragraph exists solely to serve as an [[blank:example]], which makes it both useful and completely [[blank:useless]] at the same time. Its main purpose is to pretend it has a purpose, while subtly teaching you that sometimes learning happens through [[blank:nonsense]] rather than deep meaning.
10 |
11 |
12 | __Suggested Answers__
13 |
14 | - test
15 | - example
16 | - useless
17 | - nonsense
18 |
--------------------------------------------------------------------------------
/data/examples/mcq.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Multiple Choice
4 |
5 | __Practice Question__
6 |
7 | Let's test your understanding! Maria is a freelance designer who wants to be known for "high-quality, timely work." She delivers beautiful designs but always misses deadlines. According to the brand triangle, what's her main problem?
8 |
9 | A. Her brand identity is wrong
10 | B. Her actual brand doesn't match her identity
11 | C. Her brand image is too positive
12 | D. She needs a better logo
13 |
14 | __Suggested Answers__
15 |
16 | - A
17 | - B - Correct
18 | - C
19 | - D
20 |
--------------------------------------------------------------------------------
/data/examples/fill-in-the-blanks.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Fill In The Blanks
4 |
5 | __Markdown With Blanks__
6 |
7 | Fill in the blanks
8 |
9 | > Lisa notices her team member Kevin always needs time to process decisions and gets anxious with quick turnarounds. Instead of continuing her usual [[blank:fast-moving]] approach, Lisa decides to provide more [[blank:advance]] notice and processing time. This shows she's acting like a [[blank:coach]] rather than just a [[blank:scorekeeper]].
10 |
11 | __Suggested Answers__
12 |
13 | - fast-moving
14 | - advance
15 | - coach
16 | - scorekeeper
17 | - manager
18 |
19 |
20 |
--------------------------------------------------------------------------------
/data/examples/matching.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Matching
4 |
5 | __Markdown With Blanks__
6 |
7 | > **Subtle Cue 1**: Team members are avoiding eye contact and have closed body language. [[blank:Discomfort]]
8 |
9 | > **Subtle Cue 2**: Several people are nodding, smiling, and leaning forward during a discussion. [[blank:Engagement]]
10 |
11 | > **Subtle Cue 3**: Voices are raised and people are talking over each other. [[blank:Tension]]
12 |
13 | > **Subtle Cue 4**: Someone sighs and looks away when a topic comes up. [[blank:Frustration]]
14 |
15 | > **Subtle Cue 5**: Laughter and relaxed posture spread through the group after a team win. [[blank:Relief]]
16 |
17 | __Suggested Answers__
18 |
19 | - Discomfort
20 | - Engagement
21 | - Tension
22 | - Frustration
23 | - Relief
24 |
--------------------------------------------------------------------------------
/data/examples/fib-multiple.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Fill In The Blanks
4 |
5 | __Markdown With Blanks__
6 |
7 | Fill in the blanks
8 |
9 | > **Example 1**: Someone crosses their arms and avoids eye contact during a tough conversation. [[blank:Physical]]
10 |
11 | > **Example 2**: A person says, "You always do this!" when feeling upset. [[blank:Verbal]]
12 |
13 | > **Example 3**: You notice your heart beating faster and feel the urge to interrupt. [[blank:Emotional]]
14 |
15 | > **Example 4**: Someone starts raising their voice and brings up old arguments. [[blank:Verbal]]
16 |
17 | > **Example 5**: You clench your fists and your jaw feels tight. [[blank:Physical]]
18 |
19 | > **Example 6**: You catch yourself thinking, "That's not fair!" and planning your comeback instead of listening. [[blank:Emotional]]
20 |
21 | __Suggested Answers__
22 |
23 | - Physical
24 | - Physical
25 | - Verbal
26 | - Verbal
27 | - Emotional
28 | - Emotional
29 |
--------------------------------------------------------------------------------
/data/examples/swipe-left-right.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Swipe Left or Right
4 |
5 | __Practice Question__
6 |
7 | Let's test your understanding of adaptive vs. traditional management. Swipe each statement left if it represents adaptive leadership, or right if it represents traditional management.
8 |
9 | __Labels__
10 |
11 | - Left Label: Adaptive Leadership
12 | - Right Label: Traditional Mgmt
13 |
14 | __Left Label Items__
15 |
16 | - Adjusting communication style based on employee personality
17 | - Giving more project autonomy to experienced team members
18 | - Using different motivation strategies for different people
19 | - Adapting feedback delivery to individual preferences
20 |
21 | __Right Label Items__
22 |
23 | - Using the same management approach with everyone
24 | - Expecting all employees to adapt to your style
25 | - Following rigid company policies regardless of situation
26 | - Treating all team members exactly the same way
27 |
28 |
29 |
--------------------------------------------------------------------------------
/public/styles.css:
--------------------------------------------------------------------------------
1 | /* ===== ACTIVITY-SPECIFIC STYLES ===== */
2 | /* This file contains only styles specific to the learning activities */
3 |
4 | /* ===== PAGE LAYOUT ===== */
5 | html, body {
6 | height: 100%;
7 | }
8 |
9 | body {
10 | display: flex;
11 | flex-direction: column;
12 | min-height: 100vh;
13 | background: var(--Colors-Backgrounds-Main-Default);
14 | }
15 |
16 | body:has(.matching) {
17 | margin: 0;
18 | }
19 |
20 | /* Main content area */
21 | .main {
22 | flex: 1;
23 | display: flex;
24 | flex-direction: column;
25 | justify-content: center;
26 | padding: var(--UI-Spacing-spacing-mxl) var(--UI-Spacing-spacing-ms);
27 | max-width: 896px;;
28 | width: 100%;
29 | margin: 0 auto;
30 | }
31 |
32 | .main:has(.matching) {
33 | max-width: none;
34 | padding-left: 0;
35 | padding-right: 0;
36 | }
37 |
38 | /* Activity container */
39 | .activity-container {
40 | display: grid;
41 | place-items: center;
42 | min-height: 400px;;
43 | }
44 |
--------------------------------------------------------------------------------
/data/examples/mcq-2-questions.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Multiple Choice
4 |
5 | __Practice Question__
6 |
7 | Maria is a freelance designer who wants to be known for "high-quality, timely work." She delivers beautiful designs but always misses deadlines. According to the brand triangle, what's her main problem?
8 |
9 | A. Her brand identity is wrong
10 | B. Her actual brand doesn't match her identity
11 | C. Her brand image is too positive
12 | D. She needs a better logo
13 |
14 | __Suggested Answers__
15 |
16 | - A
17 | - B - Correct
18 | - C
19 | - D
20 |
21 | __Practice Question__
22 |
23 | Which of the following issues might be true for Alex, a freelance developer who wants to be known for producing "efficient, bug-free code delivered on time"? He is well-liked by clients for his speedy turnarounds, but his code is often buggy and hard for teammates to maintain. According to the brand triangle, what are his main problems?
24 |
25 | A. His actual brand doesn't match his intended identity
26 | B. He needs to improve his communication skills
27 | C. His brand image is inconsistent with his identity
28 | D. He needs a new logo
29 |
30 | __Suggested Answers__
31 |
32 | - A - Correct
33 | - B
34 | - C - Correct
35 | - D
36 |
37 |
--------------------------------------------------------------------------------
/.github/workflows/build-release.yaml:
--------------------------------------------------------------------------------
1 | name: Build and Release
2 |
3 | on:
4 | release:
5 | types: [created]
6 |
7 | permissions:
8 | contents: write
9 |
10 | jobs:
11 | build-and-release:
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - name: Checkout repository
16 | uses: actions/checkout@v4
17 |
18 | - name: Populate design system submodule
19 | run: git submodule update --init
20 |
21 | - name: Setup Node.js
22 | uses: actions/setup-node@v4
23 | with:
24 | node-version: '20'
25 | cache: 'npm'
26 |
27 | - name: Install dependencies
28 | run: npm ci
29 |
30 | - name: Archive build output
31 | run: tar -czf dist.tar.gz *
32 |
33 | - name: Upload build artifact (for workflow logs)
34 | uses: actions/upload-artifact@v4
35 | with:
36 | name: dist
37 | path: dist
38 |
39 | - name: Upload asset to existing release
40 | uses: ncipollo/release-action@v1
41 | with:
42 | token: ${{ secrets.GITHUB_TOKEN }}
43 | tag: ${{ github.event.release.tag_name }}
44 | artifacts: dist.tar.gz
45 | allowUpdates: true
46 | omitBodyDuringUpdate: true
47 | omitNameDuringUpdate: true
48 |
--------------------------------------------------------------------------------
/data/examples/fib-2.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Fill In The Blanks
4 |
5 | __Markdown With Blanks__
6 |
7 | Match the abilities with their definitions
8 |
9 | > 1. [[blank:Self-Awareness]] is the ability to recognize and understand your own emotions as they occur, allowing you to accurately assess your strengths and weaknesses and maintain grounded confidence in your interactions.
10 |
11 | > 2. [[blank:Self-Regulation]] involves controlling disruptive impulses, staying calm under pressure, and adapting to changing circumstances, which helps you maintain consistency and integrity in your actions.
12 |
13 | > 3. [[blank:Motivation]] is the internal drive that keeps you pursuing goals with energy and persistence, even when faced with setbacks, and is fueled by your own standards of excellence rather than external rewards.
14 |
15 | > 4. [[blank:Empathy]] means moving beyond surface reactions to truly understand the feelings, concerns, and motivations of others, enabling you to respond thoughtfully and build stronger relationships.
16 |
17 | > 5. [[blank:Social Skills]] refers to the ability to manage relationships and build networks effectively, using communication and collaboration skills to unite diverse groups and achieve shared objectives.
18 |
19 |
20 | __Suggested Answers__
21 |
22 | - Self-Awareness
23 | - Self-Regulation
24 | - Motivation
25 | - Empathy
26 | - Social Skills
27 |
--------------------------------------------------------------------------------
/data/question.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Matching
4 |
5 | __Markdown With Blanks__
6 |
7 | Match each description to the decision-making style it describes.
8 |
9 | > This type gets energized by bold ideas and breakthrough thinking. They absorb information rapidly and want to see bottom-line results. Visual aids showing competitive advantage are essential when presenting to them. [[blank:Charismatic]]
10 |
11 | > This type enjoys intellectual challenges and takes pride in being methodical and precise. They genuinely enjoy processing comprehensive data and want to understand your methodology as much as your conclusions. [[blank:Thinker]]
12 |
13 | > This type is suspicious by nature and will aggressively challenge every data point looking for flaws. They are primarily influenced by the credibility of the presenter and need endorsements from people they trust. [[blank:Skeptic]]
14 |
15 | > This type makes decisions based on how similar initiatives have worked in the past. They want proven methods, trusted brands, and case studies from companies they admire rather than breakthrough innovations. [[blank:Follower]]
16 |
17 | > This type fears feeling out of control, especially regarding information. They want structured raw data they can personally verify and multiple scenarios to evaluate rather than polished conclusions. [[blank:Controller]]
18 |
19 | __Suggested Answers__
20 |
21 | - Charismatic
22 | - Thinker
23 | - Skeptic
24 | - Follower
25 | - Controller
26 |
--------------------------------------------------------------------------------
/data/examples/fib-with-long-values.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Fill In The Blanks
4 |
5 | __Markdown With Blanks__
6 |
7 | Fill in the blanks
8 |
9 | > **Situation 1:** A teammate says they're feeling stressed and overwhelmed.
10 | > **Best Response:** [[blank:That sounds tough. Do you want to talk more about it?]]
11 |
12 | > **Situation 2:** A teammate suggests a new way to do something that you hadn't considered.
13 | > **Best Response:** [[blank:I hadn’t thought of it that way. Can you tell me more?]]
14 |
15 | > **Situation 3:** You notice a teammate seems quieter than usual.
16 | > **Best Response:** [[blank:You seem a bit quiet today. Is everything okay?]]
17 |
18 | > **Situation 4:** A teammate helps you finish a report on time.
19 | > **Best Response:** [[blank:Thanks for helping me with that report! I really appreciated it.]]
20 |
21 | > **Situation 5:** You want to check in after a teammate mentioned an important event.
22 | > **Best Response:** [[blank:How did it go? How did it go? How did it go? How did it go? How did it go? How did it go? How did it go?]]
23 |
24 | __Suggested Answers__
25 |
26 | - That sounds tough—do you want to talk more about it?
27 | - I hadn’t thought of it that way. Can you tell me more?
28 | - You seem a bit quiet today. Is everything okay?
29 | - Thanks for helping me with that report! I really appreciated it.
30 | - How did it go? How did it go? How did it go? How did it go? How did it go? How did it go? How did it go?
31 |
--------------------------------------------------------------------------------
/public/components/toolbar.css:
--------------------------------------------------------------------------------
1 | /* ===== GLOBAL TOOLBAR STYLES ===== */
2 |
3 | .global-toolbar {
4 | position: fixed;
5 | top: var(--UI-Spacing-spacing-ms, 16px);
6 | right: 48px;
7 | display: flex;
8 | gap: var(--UI-Spacing-spacing-xs, 8px);
9 | align-items: center;
10 | z-index: 1000;
11 | pointer-events: none; /* Allow clicks to pass through container */
12 | }
13 |
14 | .global-toolbar-tool {
15 | display: flex;
16 | align-items: center;
17 | justify-content: center;
18 | width: 40px;
19 | height: 40px;
20 | padding: 0;
21 | border: none;
22 | border-radius: var(--UI-Radius-radius-s, 8px);
23 | background: transparent;
24 | color: var(--Colors-Text-Body-Default);
25 | cursor: pointer;
26 | pointer-events: auto; /* Re-enable clicks on buttons */
27 | transition: all 0.2s ease;
28 | }
29 |
30 | .global-toolbar-tool:hover:not(:disabled) {
31 | background: transparent;
32 | opacity: 0.7;
33 | }
34 |
35 | .global-toolbar-tool:active:not(:disabled) {
36 | opacity: 0.5;
37 | }
38 |
39 | .global-toolbar-tool:disabled {
40 | opacity: 0.4;
41 | cursor: not-allowed;
42 | pointer-events: none;
43 | }
44 |
45 | .global-toolbar-tool .icon {
46 | width: 20px;
47 | height: 20px;
48 | color: currentColor;
49 | }
50 |
51 | @media (prefers-color-scheme: dark) {
52 | .global-toolbar-tool {
53 | background: transparent;
54 | }
55 |
56 | .global-toolbar-tool:hover:not(:disabled) {
57 | background: transparent;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/data/examples/fib-1.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Fill In The Blanks
4 |
5 | __Markdown With Blanks__
6 |
7 | Match the bosses with their style
8 |
9 | > **Boss 1**: You start your presentation with a bold vision and a simple chart showing the potential for rapid market growth. You avoid lengthy details and focus on the big win, using compelling visuals to capture attention. [[blank:Charismatic]]
10 |
11 | > **Boss 2**: You provide a detailed spreadsheet with raw data and multiple scenarios, allowing your boss to analyze the numbers independently. You avoid drawing conclusions for them and instead give them all the information they need to verify on their own. [[blank:Controller]]
12 |
13 | **Boss 3**: You open your pitch by referencing endorsements from respected colleagues and industry experts. You anticipate tough questions and are prepared to defend every data point, knowing your boss will challenge your credibility and sources. [[blank:Skeptic]]
14 |
15 | **Boss 4**: You organize your proposal with comprehensive research, case studies, and a clear explanation of your methodology. You give your boss time to process the information and invite them to discuss the logic behind your recommendations. [[blank:Thinker]]
16 |
17 | **Boss 5**: You highlight how similar companies have successfully implemented your idea, providing testimonials and references. You focus on proven results and established brands to reassure your boss that your proposal is a safe choice. [[blank:Follower]]
18 |
19 | __Suggested Answers__
20 |
21 | - Thinker
22 | - Follower
23 | - Charismatic
24 | - Skeptic
25 | - Controller
26 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Activity
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/data/answer.md:
--------------------------------------------------------------------------------
1 | __Type__
2 |
3 | Matching
4 |
5 | __Summary__
6 |
7 | 0/5 correct
8 |
9 | __Responses__
10 |
11 | 1. **Item 1**
12 | - Selected Answer: No answer selected
13 | - Correct Answer: Charismatic
14 | - Result: ✗ Incorrect
15 |
16 | 2. **Item 2**
17 | - Selected Answer: No answer selected
18 | - Correct Answer: Thinker
19 | - Result: ✗ Incorrect
20 |
21 | 3. **Item 3**
22 | - Selected Answer: No answer selected
23 | - Correct Answer: Skeptic
24 | - Result: ✗ Incorrect
25 |
26 | 4. **Item 4**
27 | - Selected Answer: No answer selected
28 | - Correct Answer: Follower
29 | - Result: ✗ Incorrect
30 |
31 | 5. **Item 5**
32 | - Selected Answer: Frustration
33 | - Correct Answer: Controller
34 | - Result: ✗ Incorrect
35 |
36 | __Markdown With Blanks__
37 |
38 | Match each description to the decision-making style it describes.
39 |
40 |
41 |
42 | > This type gets energized by bold ideas and breakthrough thinking. They absorb information rapidly and want to see bottom-line results. Visual aids showing competitive advantage are essential when presenting to them. [[blank:Charismatic]]
43 |
44 |
45 | > This type enjoys intellectual challenges and takes pride in being methodical and precise. They genuinely enjoy processing comprehensive data and want to understand your methodology as much as your conclusions. [[blank:Thinker]]
46 |
47 |
48 | > This type is suspicious by nature and will aggressively challenge every data point looking for flaws. They are primarily influenced by the credibility of the presenter and need endorsements from people they trust. [[blank:Skeptic]]
49 |
50 |
51 | > This type makes decisions based on how similar initiatives have worked in the past. They want proven methods, trusted brands, and case studies from companies they admire rather than breakthrough innovations. [[blank:Follower]]
52 |
53 |
54 | > This type fears feeling out of control, especially regarding information. They want structured raw data they can personally verify and multiple scenarios to evaluate rather than polished conclusions. [[blank:Controller]]
55 |
56 | __Suggested Answers__
57 |
58 | - Thinker
59 | - Follower
60 | - Skeptic
61 | - Controller
62 | - Charismatic
63 |
64 |
--------------------------------------------------------------------------------
/public/modules/sort.js:
--------------------------------------------------------------------------------
1 | export function initSort({ items, labels, question, state, postResults }) {
2 | const elContainer = document.getElementById('activity-container');
3 |
4 | // Use design system typography and spacing
5 | // Render a minimal placeholder view
6 | elContainer.innerHTML = `
7 |