Read Me

The instructions

Question Formatter

A program written in Go to format minimally altered input text directly from Word to a Brightspace import-ready CSV File.

It currently supports:

  • Multiple Choice (MC)
  • Short Answer (SA)
  • True or False (TF)
  • Written Response (WR)

It trades extra formatting in Word for a few features available in other programs such as Respondus and Brightspace’s own quiz converter: https://community.d2l.com/brightspace/kb/articles/4161-quiz-question-converter


Table of Contents


Preformatting Requirements

Add “+++” or “—” between each question, or have each question numbered sequentially (v1.54+) ‘1. , 2. , 3.’ etc

How to Use

Local browser version [WebAssembly] (v1.62+)

  1. Open the web page - https://questionformatter.netlify.app/question-formatter/
  2. Copy in Questions
  3. Press Format & Save
  4. The page will automatically prompt you to save the generated .csv, the output text will also be displayed in a text box below.

Note You can disconnect from the internet once the page has loaded and this will still work as no data is sent to an external server.

Local version [Windows] (v1.55-1.58):

  1. Download the .exe
  2. Install and run
  3. Follow the text prompts
  4. The program will automatically close on success and generate the .csv in the file location of the program

Please Note - On Windows 10 and older versions of command line, multi-line paste does not appear to work directly from the Github copy button. It does work with a drag and select copy paste.


Example of Accepted Inputs

Use the following sample inputs as a test in the text-only version (v1.51) here (https://go.dev/play/p/FTMU7afwqd-) or with the latest version of the program.

Sample Data


Click to expand v1.54+ sample inputs (text and .csv output)

v1.54+ Sample Data

 1
 2
 3
 4
 5
 6
 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Multiple choice question text example that can end in any character?

a. Option a text
b. Option b text
*c. Option c text
d. Option d text
@Feedback goes here
+++

Multiple choice question text example showing that there can be 3+ different options
a) Option a
b) Option b
c) Option c
d) Option d
e) Option e
f) Option f

Answer c
+++
What colour is the sky?
Azure or blue; orange
+++
Write the value of the 5 in the number 8526.	500
+++
Write the value of the 7 in the number 97 450.	7000 or 7 000 or 7,000
+++
Write this as a number. 7 tens of thousands, 4 hundreds and 2 ones	70402 or 70 402 or 70,402
+++
9 + 6 =
15
+++
24 + 5 =	29
@Feedback goes here
---
628 - 284 =  34    @Feedback goes here
---
The Earth is the only planet in our solar system with liquid water on its surface. 	False
---
What is the colour of grass?
answer green or brown
---
Short answer no question mark
a short answer
---
Which planet is known as the Red Planet?

1) Venus
2) Mars
3) Jupiter
4) Saturn

2

1. Mars is known as the Red Planet
TRUE

2. Venus is known as the Red Planet
F
@Here is some feedback about this question

3. Jupiter is known as the Red Planet
False

4. Who wrote the novel "Pride and Prejudice"?

A) Charles Dickens
@@Feedback for option A (from v1.5.7)
B) Jane Austen
C) Mark Twain
@@Feedback for option C (from v1.5.7)
D) George Orwell

Correct answer B.
@Overall question feedback is formatted like this
---
What is the square root of 81?

a - 8
b - 9
c - 10
d - 11
e - 999

b
---
True or false, this has been a difficult but rewarding process

true
---
True or false, v1.5.6 now includes images in the questionText?
[[example.jpg]]
true
+++
END

Table Formatting

Also works copying from a table formatted like this:

QuestionAcceptable answers
Write the value of the 5 in the number 8526.500
Write the value of the 7 in the number 97 450.7000 or 7 000 or 7,000
Write this as a number. 7 tens of thousands, 4 hundreds and 2 ones70402 or 70 402 or 70,402
9 + 6 =15
16 + 7 =23
24 + 5 =29+++
628 - 284 =344+++
The Earth is the only planet in our solar system with liquid water on its surface.False+++
The Great Wall of China is visible from space with the naked eye.false+++
True or False: Diamonds are the hardest natural substance on Earth.Answer: True+++

Prefixes for Answers

The following will be removed from an answer if written in the Word document:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
"answer "
"answer: "
"answer- "
"answers "
"answers: "
"answers- "
"correct answer "
"correct answer: "
"correct answer- "
"correct answers: "
"correct answers- "
"*"

(not case sensitive, e.g. Answer and ANSWER etc are also included)


Prefixes for Options

By default removeListPrefixes = true

This removes numbered list prefixes such as a,b,c,d or 1), 2), 3), 4), or A-, B-, C-, D- or w., x., y., z. etc when printing the options to allow for Brightspaces own ordering to be used.

The following characters can be identified as part of the list option prefixes:

1
2
3
4
5
" "
")"
"."
"-"
" -"

Feedback

Type the “@” symbol at the start of your sentence at the end of a question (v1.55+)

Question example text
@Here's some feedback

Feedback for individual options

Who wrote the novel "Pride and Prejudice"?

A) Charles Dickens
@@Feedback for option A (from v1.5.7)
B) Jane Austen
C) Mark Twain
@@Feedback for option C (from v1.5.7)
D) George Orwell

Correct answer B.
@Overall question feedback is still formatted like this

Blank Lines and Tabbed Variations

The program will ignore empty lines breaks and remove double spacing.

Tabs are considered as a potential new line and therefore considered as an option or answer for the question.


Short Answer Question Type Answers

These can be separated by the word “or” or a semicolon “;”

e.g.

What colour is the sky?
Azure or blue; light blue or sky blue

They can also be registered after a tab, this is useful when copying directly from a table of questions e.g.

What colour is the sky?  Azure or blue; light blue or sky blue

See Table Formatting for more.


Images

As of v1.56+ images can be included in the question text section by surrounding the filename with two square brackets:

Question text
[[example.jpg]]
Question answer

This will look for a folder inside Brightspace for a folder inside the course called “images”

e.g.

content/enforced/[YOURCOURSEID]/images

If you would like them to reference images inside an additional folder, add that to the input text.

Question text
[[module-1/example.jpg]]
Question answer

This will look for the file in that folder:

content/enforced/[YOURCOURSEID]/images/module-1/example.jpg

If your folder has a space in it e.g. “Module 1” currently the space will need to be replaced by the html code for space: “%20”, so your image would be referenced like this: [[Module%201/example.jpg]] (I’ll fix this in an update).


Example Output

Click to expand example output
NewQuestionMC
ID
Title
QuestionTextWhat is the capital of Australia?
Points
Difficulty
Image
Option0Sydney
Option0Melbourne
Option100Canberra
Option0Adelaide
Hint
Feedback
NewQuestionMC
ID
Title
QuestionTextWhat is the capital of Australia?
Points
Difficulty
Image
Option0Sydney
Option0Melbourne
Option100Canberra
Option0Adelaide
Hint
Feedback
NewQuestionSA
ID
Title
QuestionTextWrite the value of the 5 in the number 8526.
Points
Difficulty
Image
Answer100500
Hint
Feedback
NewQuestionSA
ID
Title
QuestionTextWrite the value of the 7 in the number 97 450.
Points
Difficulty
Image
Answer1007000
Answer1007 000
Answer1007,000
Hint
Feedback
NewQuestionSA
ID
Title
QuestionTextWrite this as a number. 7 tens of thousands, 4 hundreds and 2 ones
Points
Difficulty
Image
Answer10070402
Answer10070 402
Answer10070,402
Hint
Feedback
NewQuestionSA
ID
Title
QuestionText9 + 6 =
Points
Difficulty
Image
Answer10015
Hint
Feedback
NewQuestionSA
ID
Title
QuestionText16 + 7 =
Points
Difficulty
Image
Answer10023
Hint
Feedback
NewQuestionSA
ID
Title
QuestionText24 + 5 =
Points
Difficulty
Image
Answer10029
Hint
Feedback
NewQuestionTF
ID
Title
QuestionTextThe Earth is the only planet in our solar system with liquid water on its surface.
Points
Difficulty
Image
TRUE0
FALSE100
Hint
Feedback
NewQuestionSA
ID
Title
QuestionTextWhat is the colour of grass?
Points
Difficulty
Image
Answer100green
Answer100brown
Hint
Feedback
NewQuestionSA
ID
Title
QuestionTextShort answer no question mark
Points
Difficulty
Image
Answer100a short answer
Hint
Feedback
NewQuestionMC
ID
Title
QuestionTextWhich planet is known as the Red Planet?
Points
Difficulty
Image
Option0Venus
Option100Mars
Option0Jupiter
Option0Saturn
Hint
Feedback
NewQuestionTF
ID
Title
QuestionTextMars is known as the Red Planet
Points
Difficulty
Image
TRUE100
FALSE0
Hint
Feedback
NewQuestionTF
ID
Title
QuestionTextVenus is known as the Red Planet
Points
Difficulty
Image
TRUE0
FALSE100
Hint
Feedback
NewQuestionTF
ID
Title
QuestionTextJupiter is known as the Red Planet
Points
Difficulty
Image
TRUE0
FALSE100
Hint
Feedback
NewQuestionMC
ID
Title
QuestionTextWho wrote the novel “Pride and Prejudice”?
Points
Difficulty
Image
Option0Charles Dickens
Option100Jane Austen
Option0Mark Twain
Option0George Orwell
Hint
Feedback
NewQuestionMC
ID
Title
QuestionTextWhat is the square root of 81?
Points
Difficulty
Image
Option08
Option1009
Option010
Option011
Option0999
Hint
Feedback
NewQuestionTF
ID
Title
QuestionTextTrue or false, this has been a difficult but rewarding process
Points
Difficulty
Image
TRUE100
FALSE0
Hint
Feedback
NewQuestionWR
ID
Title
QuestionTextWhat colour is the sky?
Points
Difficulty
Image
InitialText
AnswerKey

Accepted Input Types Table

The below table shows an example of accepted input types for questions and answers, it’s a bit of a mess, the previous examples might be clearer:

Click to expand table
Multiple ChoiceMultiple ChoiceShort AnswerShort AnswerTrue or FalseTrue or FalseWritten ResponseWritten Response
Accepted InputsAccepted Answer InputsAccepted InputsAccepted Answer InputsAccepted InputsAccepted Answer InputsAccepted InputsAccepted Answer Inputs
Question text

a
*b
c
d
*bQuestion text

Single answer
Single answerQuestion text

TRUE
TRUEQuestion textNone required
Question text

1
2
3
4

Correct answer 2
Correct answer 2Question text ending in a question mark?

answer 1 or answer 2 or answer 3
answer 1 or answer 2 or answer 3Question text ending in a question mark?

T
TQuestion text ending in a question mark?
Question text

w
x
y
z

Answer x
Answer xQuestion text

answer 1; answer 2; answer 3
answer 1; answer 2; answer 3true
Question text

a
b
c
d
e
f


correct answer: b
correct answer: banswer 1 or answer 2; answer 3FaLsE

Developed by Alex Barnes-Keoghan

Licensed under CC BY-NC-SA 4.0
© Based on the marvellous Stack template by Jimmycai
Parallax stars effect by Sarazond, grid background by Temani Afif