Quiz Lessons

Quiz lessons contain multiple-choice questions to assess knowledge retention and reinforce key concepts.

Configuration

Example from cypher-fundamentals course showing multiple questions in a lesson:

= Introduction to Cypher
:type: video
:order: 1
:slides: true

[.video]
video::jEIE_b1MzAE[youtube,width=560,height=315]


[.quiz]
== Check your understanding


:leveloffset: +1

[.question]
= 1. Read data

Which Cypher clause do you use to read data from Neo4j?

* [ ] `FIND`
* [ ] `SELECT`
* [x] `MATCH`
* [ ] `FROM`

[TIP,role=hint]
.Hint
====
This Cypher clause is typically used to return data to the client using a RETURN clause.
====

[TIP,role=solution]
.Solution
====
You use the `MATCH` clause to define the pattern in the graph that you would like to search for.
====

:leveloffset!:

:leveloffset: +1

[.question]
= 2. Filtering

What Cypher keyword can you use to filter the nodes retrieved during the execution of a `MATCH` clause?

* [ ] `FILTER`
* [ ] `SELECT`
* [x] `WHERE`
* [ ] `FROM`

[TIP,role=hint]
.Hint
====
You specify this keyword after `MATCH` before results are returned to the client.
====

[TIP,role=solution]
.Solution
====
Just like SQL, you use the `WHERE` clause to filter results in Cypher.
====

:leveloffset!:

:leveloffset: +1

[.question.select-in-source]
= 3. Retrieving a property

We want to know what the tagline is for the movie, _The Matrix_.
Use the dropdown below complete the query.

Once you have selected your option, click the **Check Results** query button to continue.

[source,cypher,role=nocopy noplay]

MATCH (m:Movie) /select:WHERE m.title = 'The Matrix'/ RETURN m.tagline

* [ ] `SELECT m.title = 'The Matrix'`
* [ ] `HAVING {title: 'The Matrix'}`
* [ ] `WHERE m {title: 'The Matrix'}`
* [x] `WHERE m.title = 'The Matrix'`

[TIP,role=hint]
.Hint
====
You use this clause to filter data after a `MATCH` clause.
This is an alternative to filtering the data inline.
====

[TIP,role=solution]
.Solution
====
The `:Movie` node is aliased with `m`, and we are looking for any nodes with the `title` property equal to **The Matrix**.

Therefore, the answer will be `WHERE m.title = 'The Matrix'`.
====

:leveloffset!:

[.summary]
== Summary

In this lesson, you learned how write queries to retrieve nodes from the graph.

Required Attributes

  • :type: quiz - Identifies this as a quiz lesson

  • :order: - Numeric order within the module

  • Title - Level 1 heading for the quiz

  • questions::[] - Directive to display questions

Question Files

Quiz lessons display multiple questions defined in the questions subdirectory.

Each question file should be numbered (e.g., 1-first-question.adoc, 2-second-question.adoc).

Question file structure:

[.question]
= 1. Read data

Which Cypher clause do you use to read data from Neo4j?

* [ ] `FIND`
* [ ] `SELECT`
* [x] `MATCH`
* [ ] `FROM`

[TIP,role=hint]
.Hint
====
This Cypher clause is typically used to return data to the client using a RETURN clause.
====

[TIP,role=solution]
.Solution
====
You use the `MATCH` clause to define the pattern in the graph that you would like to search for.
====

Question Structure

Each question file includes:

  • [.question] - Role on the heading to identify this as a question

  • = Question Title - Level 1 heading with the question title/number

  • Question text - Paragraph(s) describing what is being asked

  • Answer options - Multiple choice using * [ ] for incorrect, * [x] for correct

  • [TIP,role=hint] with .Hint title - Optional hint for the learner

  • [TIP,role=solution] with .Solution title - Explanation shown after answering

Multiple Correct Answers

Questions can have multiple correct answers by marking multiple options with [x]:

[.question]
= Data in Neo4j

Data within Neo4j is stored and organized using which of the following? (Select all that apply)

* [x] Nodes
* [x] Relationships
* [x] Labels
* [x] Properties

[TIP,role=hint]
.Hint
====
Nodes and relationships are the fundamental elements of a graph database.
Labels categorize nodes, and properties store data within nodes and relationships.
====

[TIP,role=solution]
.Solution
====
Data within Neo4j is stored and organized using *nodes*, *relationships*, *labels*, and *properties*.
====

Select in Source Questions

For coding challenges, use the .question.select-in-source pattern:

[.question.select-in-source]
= Create a new driver instance

Complete the code below to create a new driver instance.

[source,Java,role=nocopy noplay]

var driver = GraphDatabase./select:driver(/( NEO4J_URI, AuthTokens.basic(NEO4J_USERNAME, NEO4J_PASSWORD) );

- [ ] `connect`
- [x] `driver`
- [ ] `GraphDatabase`
- [ ] `new_driver`

[TIP,role=hint]
.Hint
====
What is the name of the object used to connect a Neo4j instance?
====

[TIP,role=solution]
.Solution
====
The method to create a new connection is `GraphDatabase.driver()`.
====

The /select:driver(/ marker indicates where the answer should be inserted.

Quiz Patterns

Pattern 1: Questions in Lesson

Include a single question at the end of a content-rich lesson using questions::[]. This verifies understanding immediately after teaching.

Pattern 2: Separate Quiz Lesson

Create a dedicated quiz lesson following a standard lesson. This is useful when:

  • You want to maintain flow in the content lesson (auto-completion)

  • You have multiple related questions

  • Questions build on each other sequentially

Example from the Python Driver course:

  • Lesson 1: "Creating a Driver Instance" (standard lesson, auto-completes)

  • Lesson 2: "Quiz" (quiz lesson with multiple sequential questions)

This pattern lets learners read without barriers, then explicitly test their understanding.

Best Practices

  • Ask clear, unambiguous questions

  • Provide 3-5 answer options

  • Make incorrect options plausible

  • Include explanations for all answers

  • Use hints sparingly

  • Build questions sequentially when they relate to each other

  • Avoid trick questions

  • Test knowledge, not memorization

Summary

In this lesson, you learned about quiz lessons in GraphAcademy.

Quiz lessons require :type: quiz and questions::[], with question files in the questions subdirectory.

Chatbot

How can I help you today?