keefereuther commited on
Commit
b1bc5d2
·
verified ·
1 Parent(s): 47637a0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -751
README.md CHANGED
@@ -1,764 +1,37 @@
1
  ---
2
  license: gpl-3.0
3
- title: text2qti
4
  sdk: streamlit
5
- emoji: 🏃
6
  colorFrom: green
7
  colorTo: gray
8
- short_description: Create quizzes in QTI format from Markdown-based plain text
9
  sdk_version: 1.45.1
10
  ---
11
- # text2qti Create quizzes in QTI format from Markdown-based plain text
12
 
13
- text2qti converts
14
- [Markdown](https://daringfireball.net/projects/markdown/)-based plain text
15
- files into quizzes in QTI format (version 1.2), which can be imported by
16
- [Canvas](https://www.instructure.com/canvas/) and other educational software.
17
- It supports multiple-choice, true/false, multiple-answers, numerical,
18
- short-answer (fill-in-the-blank), essay, and file-upload questions. It
19
- includes basic support for LaTeX math within Markdown, and allows a limited
20
- subset of [siunitx](https://ctan.org/pkg/siunitx) notation for units and for
21
- numbers in scientific notation.
22
 
 
 
 
 
 
23
 
 
 
 
 
 
24
 
25
- ## Examples
26
 
27
- text2qti allows quick and efficient quiz creation. Example
28
- **multiple-choice** plain-text quiz question that can be converted to QTI and
29
- then imported by Canvas:
30
-
31
- ```
32
- 1. What is 2+3?
33
- a) 6
34
- b) 1
35
- *c) 5
36
- ```
37
-
38
- A **question** is created by a line that starts with a number followed by a
39
- period and one or more spaces or tabs ("`1. `"). Possible **choices** are
40
- created by lines that start with a letter followed by a closing parenthesis
41
- and one or more spaces or tabs ("`a) `"). Numbers and letters do not have to
42
- be ordered or unique. The **correct** choice is designated with an asterisk
43
- ("`*c) `"). All question and choice text is processed as
44
- [Markdown](https://daringfireball.net/projects/markdown/).
45
-
46
- There is also support for a quiz title and description, as well as question
47
- titles, point values, and feedback. Note that unlike most other text, titles
48
- like quiz and question titles are treated as plain text, not Markdown, due to
49
- the QTI format. **Also note that Canvas correctly shows question titles
50
- within its quiz editor for instructors, but always replaces them with titles
51
- like "Question 1" in the student view.** Question point values must be
52
- positive integers or half-integers.
53
-
54
- ```
55
- Quiz title: Addition
56
- Quiz description: Checking addition.
57
-
58
- Title: An addition question
59
- Points: 2
60
- 1. What is 2+3?
61
- ... General question feedback.
62
- + Feedback for correct answer.
63
- - Feedback for incorrect answer.
64
- a) 6
65
- ... Feedback for this particular answer.
66
- b) 1
67
- ... Feedback for this particular answer.
68
- *c) 5
69
- ... Feedback for this particular answer.
70
- ```
71
-
72
- **Multiple-answers questions** use `[]` or `[ ]` for incorrect answers and
73
- `[*]` for correct answers.
74
-
75
- ```
76
- 1. Which of the following are dinosaurs?
77
- [ ] Woolly mammoth
78
- [*] Tyrannosaurus rex
79
- [*] Triceratops
80
- [ ] Smilodon fatalis
81
- ```
82
-
83
- **Numerical questions** use an equals sign followed by one or
84
- more spaces or tabs followed by the numerical answer. Acceptable answers can
85
- be designated as a range of the form `[<min>, <max>]` or as a correct answer
86
- with a specified acceptable margin of error `<ans> +- <margin>`. When the
87
- latter form is used, `<margin>` can be either a number or a percentage.
88
- `<margin>` can be omitted when the answer is an integer and an exact answer is
89
- required. In this case, scientific notation is not permitted, but the
90
- underscore can be used as a digit separator; for example, `1000` and `1_000`
91
- are both valid, but `1e3` is not. An exact answer can be required for
92
- floating-point numbers, but this requires an explicit `+- 0`, since a range is
93
- typically more appropriate for floating-point values. Numerical questions
94
- have the limitation that the absolute value of the smallest acceptable answer
95
- must be greater than or equal to 0.0001 (1e-4).
96
-
97
- ```
98
- 1. What is the square root of 2?
99
- = 1.4142 +- 0.0001
100
-
101
- 2. What is the cube root of 2?
102
- = [1.2598, 1.2600]
103
-
104
- 3. What is 2+3?
105
- = 5
106
- ```
107
-
108
- **Short-answer (fill-in-the-blank) questions** use an asterisk followed by one
109
- or more spaces or tabs followed by an answer. Multiple acceptable answers can
110
- be given. Answers are restricted to a single line each and are treated as
111
- plain text, not Markdown.
112
- ```
113
- 1. Who lives at the North Pole?
114
- * Santa
115
- * Santa Claus
116
- * Father Christmas
117
- * Saint Nicholas
118
- * Saint Nick
119
- ```
120
-
121
- **Essay questions** are indicated by a sequence of three or more underscores.
122
- They only support general question feedback.
123
-
124
- ```
125
- 1. Write an essay.
126
- ... General question feedback.
127
- ____
128
- ```
129
-
130
- **File-upload questions** are indicated by a sequence of three or more
131
- circumflex accents. They only support general question feedback.
132
- ```
133
- 1. Upload a file.
134
- ... General question feedback.
135
- ^^^^
136
- ```
137
-
138
- **Text regions** outside of questions are supported. Note that unlike most
139
- other text, titles like text region titles are treated as plain text, not
140
- Markdown, due to the QTI format. Also note that Canvas apparently ignores the
141
- text region title and only displays the text itself. Text regions are not
142
- required to have both a title and text; either may be used alone, but the
143
- title must come first when both are present.
144
- ```
145
- Text title: Instructions about the next questions
146
- Text: General comments about the next questions.
147
- ```
148
-
149
-
150
- ## File format
151
-
152
- The text2qti file format is a plain-text file format that serves as a wrapper
153
- around Markdown. Each individual chunk of text (question, answer, feedback,
154
- etc.) is Markdown. But the outermost level of text (no indentation) is the
155
- text2qti plain-text quiz format. The fact that the Markdown is indented
156
- within the text2qti format is only really visible when multiple lines of
157
- Markdown are involved. The indentation for each chunk of Markdown text doesn't
158
- have to be 4 spaces; it just has to be the same for the whole chunk of text
159
- that makes up each element of a question.
160
-
161
- ```
162
- **No indentation: text2qti wrapper syntax for Markdown**
163
- |
164
- | **Indentation: Now using Markdown**
165
- | **Everything below this must have at least this indentation**
166
- | |
167
- 1. Question.
168
- | |
169
- | Question continued, so indentation.
170
- | |
171
- *a) Correct answer.
172
- | |
173
- | Correct answer continued, so indentation.
174
- | |
175
- b) Another answer.
176
- | |
177
- ```
178
-
179
-
180
- ## Installation
181
-
182
- Install **Python 3.8+** if it is not already available on your machine. See
183
- https://www.python.org/, or use the package manager or app store for your
184
- operating system. Depending on your use case, you may want to consider a
185
- Python distribution like [Anaconda](https://www.anaconda.com/distribution/)
186
- instead.
187
-
188
- Install
189
- [setuptools](https://packaging.python.org/tutorials/installing-packages/)
190
- for Python if it is not already installed. This can be accomplished by
191
- running
192
- ```
193
- python -m pip install setuptools
194
- ```
195
- on the command line. Depending on your system, you may need to use `python3`
196
- instead of `python`. This will often be the case for Linux and OS X.
197
-
198
- Install text2qti by running this on the command line:
199
- ```
200
- python -m pip install text2qti
201
- ```
202
- Depending on your system, you may need to use `python3` instead of `python`.
203
- This will often be the case for Linux and OS X.
204
-
205
-
206
- ### Upgrading
207
-
208
- ```
209
- python -m pip install text2qti --upgrade
210
- ```
211
- Depending on your system, you may need to use `python3` instead of `python`.
212
- This will often be the case for Linux and OS X.
213
-
214
-
215
- ### Installing the development version
216
-
217
- If you want to install the development version to use the latest features,
218
- download `text2qti` from [GitHub](https://github.com/gpoore/text2qti) and
219
- extract the files. A few different ways to install the development version
220
- are listed below. Depending on your system, you may need to use `python3`
221
- instead of `python` in the commands below. This will often be the case for
222
- Linux and OS X.
223
-
224
- * You can install using the included `setup.py` by running
225
- ```
226
- python setup.py install
227
- ```
228
- Depending on your system configuration, especially if you do not have root
229
- or administrator privileges, you may want to
230
- [customize the installation location](https://docs.python.org/3.8/install/#alternate-installation-the-user-scheme).
231
- For example, you can add `--user` to install under `%APPDATA%\Python` (Windows), `~/.local` (UNIX, and Mac OS X non-framework builds), or
232
- `~/Library/Python/<VERSION>` (Mac framework builds):
233
- ```
234
- python setup.py install --user
235
- ```
236
- * You can install using `pip`. For example, in the directory with `setup.py`,
237
- run this:
238
- ```
239
- python -m pip install .
240
- ```
241
-
242
-
243
-
244
-
245
- ## Usage
246
-
247
- text2qti has been designed to create QTI files for use with
248
- [Canvas](https://www.instructure.com/canvas/). Some features may not be
249
- supported by other educational software. You should **always preview**
250
- quizzes or assessments after converting them to QTI and importing them.
251
-
252
- Write your quiz or assessment in a plain text file. You can use a basic
253
- editor like Notepad or gedit, or a code editor like
254
- [VS Code](https://code.visualstudio.com/). You can even use Microsoft Word,
255
- as long as you save your file as plain text (*.txt).
256
-
257
- text2qti includes a graphical application and a command-line application.
258
-
259
- * To use the graphical application, open a command line and run `text2qti_tk`.
260
-
261
- * To use the command-line application, open a command line in the same folder
262
- or directory as your quiz file. Under Windows, you can hold the SHIFT
263
- button down on the keyboard, then right click next to your file, and select
264
- "Open PowerShell window here" or "Open command window here". You can also
265
- launch "Command Prompt" or "PowerShell" through the Start menu, and then
266
- navigate to your file using `cd`.
267
-
268
- Run the `text2qti` application using a command like this:
269
- ```
270
- text2qti quiz.txt
271
- ```
272
- Replace "quiz.txt" with the name of your file. This will create a file like
273
- `quiz.zip` (with "quiz" replaced by the name of your file) which is the
274
- converted quiz in QTI format.
275
-
276
- Instructions for using the QTI file with Canvas:
277
- * Go to the course in which you want to use the quiz.
278
- * Go to Settings, click on "Import Course Content", select "QTI .zip file",
279
- choose your file, and click "Import". Typically you should not need to
280
- select a question bank; that should be managed automatically.
281
- * While the quiz upload will often be very fast, there is an additional
282
- processing step that can take up to several minutes. The status will
283
- probably appear under "Current Jobs" after upload.
284
- * Once the quiz import is marked as "Completed", the imported quiz should be
285
- available under Quizzes. If the imported quiz does not appear after
286
- several minutes, there may be an error in your quiz file or a bug in
287
- `text2qti`. When Canvas encounters an invalid quiz file, it tends to fail
288
- silently; instead of reporting an error in the quiz file, it just never
289
- creates a quiz based on the invalid file.
290
- * You should **always preview the quiz before use**. text2qti can detect a
291
- number of potential issues, but not everything.
292
-
293
- Typically, you should start your quizzes with a title, like this:
294
- ```
295
- Quiz title: Title here
296
- ```
297
- Otherwise, all quizzes will have the default title "Quiz", so it will be
298
- difficult to tell them apart. Another option is to rename quizzes after
299
- importing them. Note that unlike most other text, the title is treated as
300
- plain text, not Markdown, due to the QTI format.
301
-
302
- When you run `text2qti` for the first time, it will attempt to create a
303
- configuration file called `.text2qti.bespon` in your home or user directory.
304
- It will also ask for an institutional LaTeX rendering URL. This is only
305
- needed if you plan to use LaTeX math and if the default URL
306
- `/equation_images/` will not work with your system. In typical cases, you can
307
- simply press ENTER to continue with the default value.
308
- * If you use Canvas, log into your account and look in the browser address
309
- bar. You will typically see an address that starts with something like
310
- `institution.instructure.com/` or `canvas.institution.edu/`, with
311
- `institution` replaced by the name of your school or an abbreviation for
312
- it. The LateX rendering URL that you want to use will then be something
313
- like `https://institution.instructure.com/equation_images/` or
314
- `https://canvas.institution.edu/equation_images/`, with `institution`
315
- replaced by the appropriate value for your school. If the URL is like the
316
- second form, you may need to replace the `.edu` domain with the appropriate
317
- value for your institution.
318
- * If you use other educational software that handles LaTeX in a manner
319
- compatible with Canvas, consult the documentation for your software. Or
320
- perhaps create a simple quiz within the software using its built-in tools,
321
- then export the quiz to QTI and look through the resulting output to find
322
- the URL.
323
- * If you are using educational software that does not handle LaTeX in a
324
- manner compatible with Canvas, try the `--pandoc-mathml` command-line
325
- option when creating QTI files (note that this requires that
326
- [Pandoc](https://pandoc.org/) be installed). If that does not work, please
327
- open an issue requesting support for that software, and include as much
328
- information as possible about how that software processes LaTeX.
329
-
330
-
331
-
332
- ## Additional features
333
-
334
- ### Question groups
335
-
336
- A question group contains multiple questions, and only a specified number of
337
- these are randomly selected and used each time a quiz is taken.
338
-
339
- ```
340
- GROUP
341
- pick: 1
342
- points per question: 1
343
-
344
- 1. A question.
345
- *a) true
346
- b) false
347
-
348
- 2. Another question.
349
- *a) true
350
- b) false
351
-
352
- END_GROUP
353
- ```
354
-
355
- The number of questions from the group that are used is specified with
356
- "`pick:`". If this is omitted, it defaults to `1`. The points assigned per
357
- question is specified with "`points per question:`". If this is omitted, it
358
- defaults to `1`. All questions within a group must be worth the same number
359
- of points.
360
-
361
-
362
- ### Executable code blocks
363
-
364
- text2qti can execute the code in Markdown-style fenced code blocks. Code can
365
- be used to generate questions within a quiz. Everything written to stdout by
366
- the executed code is included in the quiz file; the code block is replaced by
367
- stdout.
368
-
369
- ``````
370
- ```{.python .run}
371
- import textwrap
372
- for x in [2, 3]:
373
- print(textwrap.dedent(rf"""
374
- 1. What is ${x}\times 5$?
375
- *a) ${x*5}$
376
- b) ${x+1}$
377
- """))
378
- ```
379
- ``````
380
-
381
-
382
- For code to be executed, there are a few requirements:
383
-
384
- * The code block fences (` ``` `) must not be indented; the code block must be
385
- at the top level of the document, not part of a question, choice, or
386
- feedback. In contrast, a regular code block that is part of a question,
387
- choice, or feedback must be indented as part of that quiz element.
388
-
389
- * As a security measure, code execution is disabled by default, so executable
390
- code blocks will trigger an error. Run `text2qti` with the option
391
- `--run-code-blocks` to enable code execution, or set `run_code_blocks =
392
- true` in the text2qti config file in your user or home directory.
393
-
394
- * The text immediately after the opening fence must have the form
395
- `{.lang .run}` or `{.lang .run executable=<executable>}`. This is inspired
396
- by the code-block attributes in
397
- [Pandoc Markdown](https://pandoc.org/MANUAL.html).
398
-
399
- If the keyword argument `executable` is not provided, then `lang` must
400
- designate an executable that can run the code once the code has been saved
401
- to a file. In the example above, `python` is extracted from the first line
402
- (` ```{.python .run}`), code is saved in a temporary file, and then the
403
- file is executed via `python <file>`.
404
-
405
- If `executable` is used to specify an executable, then `lang` is ignored by
406
- `text2qti`, but it is still useful since some editors will use it to provide
407
- syntax highlighting.
408
-
409
- When `executable` is specified, the executable path must be quoted with
410
- double quotes `"` if it contains anything other than the tilde, Unicode word
411
- characters, numbers, forward slashes, periods, hyphens, and underscores.
412
- When the executable path is quoted, backslashes and quotation marks are
413
- still prohibited; forward slashes should be used under all operating systems
414
- including Windows. A leading `~` in the executable path is expanded to the
415
- user's home directory under all operating systems including Windows.
416
-
417
- * **Special Python note**: When `.python` is used with an executable code
418
- block without specifying an `executable`, code will run with `python3` if
419
- either of these conditions is met:
420
-
421
- - `python3` exists on the system and `python` is equivalent to `python2`.
422
-
423
- - `python` does not exist on the system, but `python3` does exist.
424
-
425
- To avoid ambiguity, you may want to use `.python3` and `.python2` rather
426
- than `.python` when working with operating systems other than Windows, or
427
- when working with a Windows installation that includes a `python3`
428
- executable or symlink. It is also possible to be even more specific by
429
- using something like `.python3.8`.
430
-
431
- Each code block is executed in its own process, so data and variables are not
432
- shared between code blocks.
433
-
434
- If an executable code block generates multiple questions that are identical,
435
- or multiple choices for a single question that are identical, this will be
436
- detected by `text2qti` and an error will be reported. Questions or choices
437
- that may be equivalent, but are not represented by exactly the same text,
438
- cannot be detected (for example, things like `100` versus `1e2`, or `answer`
439
- versus `Answer`).
440
-
441
-
442
- ### Additional quiz options
443
-
444
- There are additional quiz options that can be set immediately after the quiz
445
- title and quiz description. These all take values `true` or `false`. For
446
- example, `shuffle answers: true` could be on the line right after the quiz
447
- description.
448
-
449
- * `shuffle answers` — Shuffle answer order for questions.
450
- * `show correct answers` — Show correct answers after submission.
451
- * `one question at a time` — Only show one question at a time.
452
- * `can't go back` — Don't allow going back to the previous question when in
453
- `one question at a time` mode.
454
-
455
-
456
-
457
-
458
- ## Details for writing quiz text
459
-
460
- text2qti processes almost all text as
461
- [Markdown](https://daringfireball.net/projects/markdown/), using
462
- [Python-Markdown](https://python-markdown.github.io/). (The only exceptions
463
- are the quiz title, question titles, and text region titles, which are
464
- processed as plain text due to the QTI format, plus the acceptable answers
465
- for short-answer questions.) For example, `*emphasized*` produces *emphasized*
466
- text, which typically appears as italics. Text can be styled using Markdown
467
- notation, or with HTML. Remember to preview quizzes after conversion to QTI,
468
- especially when using any significant amount of HTML.
469
-
470
- Python-Markdown provides several
471
- [extensions to basic Markdown](https://python-markdown.github.io/extensions/).
472
- Currently, the following extensions are enabled:
473
- * `smarty`: Automatic curly quotation marks and dashes.
474
- * `sane_lists`: List behavior is closer to what might be expected.
475
- * `def_list`: Definition lists of this form:
476
- ```
477
- term
478
- : definition
479
- * `fenced_code`: Fenced code blocks (` ``` ` or `~~~`).
480
- * `footnotes`: Footnotes using this form:
481
- ```
482
- Normal text [^1].
483
-
484
- [^1]: Footnote text.
485
- * `tables`: Tables of this form:
486
- ```
487
- Header | Header
488
- ------ | ------
489
- Cell | Cell
490
- Cell | Cell
491
- ```
492
- * `md_in_html`: Text inside HTML tags is treated as Markdown. This requires
493
- setting the attribute `markdown="1"` in the opening tag for block-level
494
- elements. See the
495
- [documentation](https://python-markdown.github.io/extensions/md_in_html/)
496
- for more details about proper usage and potential issues.
497
-
498
- While indented Markdown code blocks are supported, fenced code blocks should
499
- be preferred. Indented code can interfere with the preprocessor that strips
500
- HTML comments and handles LaTeX math and siunitx notation.
501
-
502
-
503
- ### Titles
504
-
505
- Quiz, question, and text region titles are limited to a single paragraph. If
506
- this paragraph is wrapped over multiple lines, all lines after the first must
507
- be indented by at least two spaces or one tab, and share the same indentation.
508
- All tabs are expanded to 4 spaces before indentation is compared, following
509
- the typical Markdown approach.
510
-
511
- All titles are treated as plain text, not Markdown, due to the QTI format.
512
-
513
- Titles are always optional, but when they are used for a given element, they
514
- are always required to be first, before any other attributes.
515
-
516
-
517
- ### Descriptions, questions, choices, feedback, and text regions
518
-
519
- Descriptions, questions, choices, feedback, and text regions may span multiple
520
- paragraphs and include arbitrary Markdown content like code blocks or
521
- quotations. Everything must be indented to at least the same level as the
522
- start of the first paragraph on the initial line. All tabs are expanded to 4
523
- spaces before indentation is compared, following the typical Markdown
524
- approach. For example,
525
- ```
526
- 1. A question paragraph that is long enough to wrap onto a second line.
527
- The second line must be indented to match up with the start of the
528
- paragraph text on the first line.
529
-
530
- Another paragraph.
531
- ```
532
- Note that the acceptable answers for short-answer questions are treated as
533
- plain text and limited to a single line, and numerical answers are also
534
- processed specially and limited to a single line.
535
-
536
-
537
- ### Images
538
-
539
- Images are included with the standard Markdown syntax:
540
- ```
541
- ![alt_text](image_file)
542
- ```
543
- It will typically be easiest to put your image files in the same folder or
544
- directory as the quiz file, so you can use something like `![alt](image.jpg)`.
545
- However, file paths are supported, including `~` user expansion under all
546
- operating systems. All image paths not starting with `http://` or `https://`
547
- are assumed to refer to local image files (files on your machine), and will
548
- result in errors if these files are not found.
549
-
550
- [Pandoc-style attributes](https://pandoc.org/MANUAL.html#images) can be used
551
- with images:
552
- ```
553
- ![alt_text](image_file){#id .class1 .class2 width=10em height=5em}
554
- ```
555
- This allows image id, classes, and dimensions to be specified without
556
- resorting to HTML.
557
-
558
-
559
- ### LaTeX
560
-
561
- By default, text2qti supports LaTeX using a Canvas LaTeX rendering URL that
562
- defaults to `/equation_images/`. This can be customized during installation,
563
- or by editing the configuration file `.text2qti.bespon` in your home or user
564
- directory. It is possible to convert LaTeX to MathML instead with the
565
- `--pandoc-mathml` command-line option. This requires that
566
- [Pandoc](https://pandoc.org/) be installed for converting LaTeX to MathML.
567
- For example, to create a quiz you might run a command like this:
568
- ```
569
- text2qti --pandoc-mathml quiz.txt
570
- ```
571
- When `--pandoc-mathml` is used, a cache file `_text2qti_cache.zip` will be
572
- created in the quiz file directory. This is used to store Pandoc MathML
573
- output to increase performance for long quizzes with lots of math.
574
-
575
- text2qti supports inline LaTeX math within dollar signs `$`. There must be a
576
- non-space character immediately after the opening `$` and immediately before
577
- the closing `$`. For example, `$F = ma$`. LaTeX math is limited to what is
578
- supported by Canvas or whatever other educational software you are using. It
579
- is usually a good idea to preview imported quizzes before assigning them,
580
- because text2qti cannot detect LaTeX incompatibilities or limitations. There
581
- is currently not support for block LaTeX math; only inline math is supported.
582
-
583
- When using Canvas with LaTeX math, be aware that in some cases Canvas's
584
- vertical alignment of math leaves much to be desired. Sometimes this can be
585
- improved by including `\vphantom{fg}` or `\strut` at the beginning of an
586
- equation. An alternative is simply to use LaTeX for all question or choice
587
- text (via `\text`, etc.).
588
-
589
- text2tqi supports a limited subset of LaTeX
590
- [siunitx](https://ctan.org/pkg/siunitx) notation. You can use notation like
591
- `\num{1.23e5}` to enter numbers in scientific notation. This would result in
592
- `1.23×10⁵`. You can use notation like `\si{m/s}` or `\si{N.m}` to enter
593
- units. These would result in `m/s` and `N·m`. Unit macros currently are not
594
- supported, with these exceptions: `\degree`, `\celsius`, `\fahrenheit`,
595
- `\ohm`, `\micro`. Finally, numbers and units can be combined with notation
596
- like `\SI{1.23e5}{m/s}`. All of these can be used inside or outside LaTeX
597
- math.
598
-
599
- Technical note: LaTeX and siunitx support are currently implemented as
600
- preprocessors that are used separately from Python-Markdown. In rare cases,
601
- this may lead to conflicts with Markdown syntax. These features may be
602
- reimplemented as Python-Markdown extensions in the future.
603
-
604
-
605
- ### Comments
606
-
607
- There are multiple ways to add comments within a quiz file. In all cases,
608
- comments are completely removed during quiz creation and do not appear in the
609
- final quiz in any form.
610
-
611
- At the top level of a quiz document (outside of questions, choices, or
612
- feedback) there are two types of comments. These comments cannot be indented.
613
- * Line comments: Any line that starts with a percent sign `%` is discarded.
614
- * Multiline comments: If a line starts with `COMMENT`, that line and all
615
- subsequent lines are discarded through a line that starts with
616
- `END_COMMENT`. The `COMMENT` and `END_COMMENT` delimiters must be on lines
617
- by themselves; otherwise, an error is raised.
618
-
619
- Within Markdown text, standard HTML comments of the form `<!--comment-->` may
620
- be used. These are stripped out during processing and do not appear in the
621
- final QTI file. HTML comments are not supported within LaTeX math.
622
-
623
- Technical note: HTML comments are currently stripped in a preprocessing step
624
- separate from Python-Markdown. In rare cases, this may conflict with raw HTML
625
- embedded in Markdown. This feature may be reimplemented as a Python-Markdown
626
- extension in the future.
627
-
628
-
629
-
630
- ## Export solutions to PDF and HTML
631
-
632
- There is basic support for exporting quiz solutions in Pandoc Markdown, PDF,
633
- and HTML formats. This is currently only available in the command-line
634
- application. Solutions exported as Pandoc Markdown are only suitable for use
635
- with LaTeX and HTML. Exporting solutions as PDF requires
636
- [Pandoc](https://pandoc.org/) and a LaTeX installation (such as [TeX
637
- Live](https://www.tug.org/texlive/) or [MiKTeX](https://miktex.org/)). There
638
- is currently no built-in support for customizing export, although you can edit
639
- the Pandoc Markdown output before processing it via Pandoc.
640
-
641
- To save solutions and also create a QTI file, use
642
- `--solutions <solutions_file>`. To save solutions without creating a QTI
643
- file, use `--only-solutions <solutions_file>`. `<solutions_file>` must have
644
- an `.md` or `.markdown` extension for Pandoc Markdown export, `.pdf` for PDF
645
- export, or `.html` for HTML export. `--solutions` and `--only-solutions` can
646
- be used multiple times to generate solutions in multiple formats.
647
-
648
- When using `--only-solutions`, be aware that solutions and QTI may differ if
649
- executable code blocks generate problems using random numbers. Consider
650
- creating solutions and QTI at the same time (`--solutions`), or setting a seed
651
- for the random number generator so it is reproducible.
652
-
653
-
654
- ### Customizing questions for solutions
655
-
656
- Each question can provide a solution or other important information that is
657
- *only* included in the solutions, *never* in the QTI. This is particularly
658
- useful for essay and upload questions, since they are defined without
659
- specifying an answer and require manual grading. For example,
660
- ```
661
- 1. Write an essay about text2qti.
662
-
663
- ! This is important information about what the essay should cover.
664
-
665
- This will only appear in the solutions, and can be as long or short as
666
- you wish.
667
-
668
- ____
669
- ```
670
- The syntax for a question solution is the same as that for question feedback,
671
- except that an exclamation point `!` is used instead of `...` or `+` or `-`.
672
-
673
-
674
- ### Quiz options
675
-
676
- At the beginning of a quiz, there are some quiz-level options that can be set
677
- to customize solutions. These all take `true`/`false` values, and are `false`
678
- by default. For example, add `solutions sample groups: true` at the beginning
679
- of a quiz.
680
-
681
- * `feedback is solution` — This disables the special question solution syntax
682
- involving `!`, and treats general question feedback (`...`) as both feedback
683
- and solution. This is useful when you want to give students solution
684
- information as part of the QTI feedback and also include this same
685
- information in solutions.
686
-
687
- * `solutions sample groups` — By default, *all* questions in a question group
688
- are included in solutions, with a notice about the number that are randomly
689
- selected when the quiz is taken, unless the question group has `solutions
690
- pick` set to use a different value.
691
-
692
- This option causes only a sample of the questions in a group to be included
693
- in the solutions. This option displays the first N questions in a group
694
- sequentially, where N is the group `solutions pick` value if it has been
695
- set, and otherwise the `pick` value if it has been set, and otherwise 1. It
696
- is possible for solutions to include N random questions from a group instead
697
- of the first N questions; see `solutions randomize groups`.
698
-
699
- * `solutions randomize groups` — For each question group, randomize the order
700
- in which questions are displayed in solutions. If only some questions from
701
- a group are included in solutions (`solutions sample groups` is `true` or
702
- `solutions pick` is set), also randomize which questions are displayed
703
- instead of taking all displayed questions sequentially from the beginning of
704
- the group.
705
-
706
- Randomization is not used by default for two reasons that relate to quizzes
707
- using `solutions pick` or `solutions sample groups`. First, including group
708
- questions sequentially allows specially chosen, representative questions to
709
- be placed at the beginning of the group so that they will appear in
710
- solutions. If a group contains many questions that are generated by an
711
- executable code block, a random selection might not provide a sample that is
712
- representative. Second, if a quiz is used several semesters or years in a
713
- row with only minor modifications, and new randomized solutions are
714
- distributed each time, this means that eventually all questions would be
715
- distributed in solutions, rather than only a fixed subset.
716
-
717
-
718
- ### Customizing groups for solutions
719
-
720
- When a quiz is taken, the number of questions randomly selected from a
721
- question group is the value of `pick` if `pick` is set for the group and
722
- otherwise 1. However, by default solutions will include *all* questions from
723
- a group. There are two ways to modify this.
724
-
725
- It is possible to modify the number of questions displayed in solutions for a
726
- specific group by setting `solutions pick` for the group. This causes only
727
- the specified number of questions from the group to be displayed in solutions.
728
- The questions that are displayed are taken sequentially from the beginning of
729
- the group by default, with no randomization. For randomization, see the
730
- quiz-level option `solutions randomize groups`.
731
-
732
- It is also possible to modify the number of questions displayed in solutions
733
- for *all* groups in a quiz by setting the quiz-level option `solutions sample
734
- groups` to `true`. This option displays the first N questions in a group
735
- sequentially, where N is the group `solutions pick` value if it has been set,
736
- and otherwise the `pick` value if it has been set, and otherwise 1. It is
737
- possible for solutions to include N random questions from a group instead of
738
- the first N questions; see `solutions randomize groups`.
739
-
740
- In the example below, the solutions would include 2 questions from the group,
741
- even though only 1 is displayed when the quiz is taken. The first 2 questions
742
- would be included in solutions, unless `solutions randomize groups: true` is
743
- included at the beginning of the quiz.
744
-
745
- ```
746
- GROUP
747
- pick: 1
748
- solutions pick: 2
749
-
750
- 1. A question.
751
- *a) true
752
- b) false
753
-
754
- 2. Another question.
755
- *a) true
756
- b) false
757
-
758
- 3. Yet another question.
759
- *a) true
760
- b) false
761
-
762
- END_GROUP
763
- ```
764
 
 
 
1
  ---
2
  license: gpl-3.0
3
+ title: Grading Equity
4
  sdk: streamlit
5
+ emoji: 🌍
6
  colorFrom: green
7
  colorTo: gray
8
+ short_description: Create syllabus grading policies that minimize inequity
9
  sdk_version: 1.45.1
10
  ---
11
+ # Grading Equity Analysis App
12
 
13
+ ## Overview
14
+ This Streamlit app analyzes grading data to assess equity in educational outcomes. It focuses on minimizing grading inequities, especially among minoritized and first-generation students.
 
 
 
 
 
 
 
15
 
16
+ ## How It Works
17
+ - The app loads a gradebook from a CSV file (`FAKE_EXAMPLE_DATA.csv`).
18
+ - It categorizes assignments into groups like attendance, study activities, quizzes, midterms, and final exams.
19
+ - Users can adjust weightings, drop scores, and set minimum scores for each group via sliders in the Streamlit sidebar.
20
+ - The app calculates final grades, median grades, grade distributions, and statistical measures like median absolute deviation and Glass's Delta.
21
 
22
+ ## Setting Up Your Own Analysis
23
+ 1. Fork the repository to create a private copy.
24
+ 2. Replace `FAKE_EXAMPLE_DATA.csv` with your own CSV file. Ensure it follows a similar structure.
25
+ 3. Modify the `assignment_groups` dictionary in `gradesimapp.py` to match your gradebook columns.
26
+ 4. Deploy your app on Streamlit Cloud or another platform.
27
 
28
+ ## Running the App Locally
29
 
30
+ 1. Ensure Python is installed on your machine.
31
+ 2. Clone your forked repository or download the source code.
32
+ 3. Navigate to the app's directory in your terminal.
33
+ 4. Install the required packages using `pip install -r requirements.txt`.
34
+ 5. Run the app with `streamlit run b3simapp.py`.
35
+ 6. The app should now be running locally and can be accessed via a web browser at the address provided by Streamlit (usually `localhost:8501`).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
+ Remember to respect student privacy and confidentiality when handling real grade data.