This collection of snippets is useful for authoring CSV formatted questions for import into the D2L / Brightspace LMS. There are snippets for every question type detailed in the sample question template provided by D2L/Brightspace.
The only prerequisites are:
- an yasnippet compatible editor (Emacs, Aquamacs, Spacemacs, etc.)
- working yasnippet installation.
You can download the repository or simply clone it into a directory of your choosing.
git clone https://github.com/ephsmith/d2l-snippets
Unzip the download.
Your custom snippets should be installed to a custom snippet directory–not the default yasnippet snippet dir.
In Aquamacs/Emacs, you can view and customize the yas-snippet-dirs
variable with the following:
M-x customize-variable RET yas-snippet-dirs
The snippets are csv-mode
snippets and should be installed into a directory of the same name under your snippet dir.
- If you don’t already have a
csv-mode
directory in your snippet directory, then simply copy the entirecsv-mode
directory from the repository to your snippet directory. - If you already have a
csv-mode
directory, copy only the contents of thecsv-mode
directory over.
To enable yasnippet
for csv-mode
only, add the following to your emacs config file:
(add-hook 'org-mode-hook 'yas-minor-mode-on)
Alternatively, you can just enable yasnippet
globally by adding this line to your emacs config:
(yas-global-mode 1)
I prefer the latter because yasnippet
doesn’t get in the way of modes I already use and it allows me the freedom to create a snippet for any mode at any time.
Reload the snippet directory contents. In emacs,
M-x yas-reload-all RET
These snippets are only active in csv-mode
. With the exception of the code
snippet, all snippets have a key that begins with d2l and ends with the D2L question type descriptor–as seen in the sample question template.