Skip to contents

Minimum version

In this type of exercise, the candidate must match rows and columns of a table. A template is automatically created when you initiate an rqti project through RStudio. Alternatively, it can be added by clicking on New file -> R Markdown -> From Template. The rqti templates start with rqti:. Here we look at the templates rqti: table (simple) and rqti: table (complex).

The minimum you need to provide is the type: table in the yaml-section and a table in a section called #question:

---
type: table
knit: rqti::render_qtijs
---

# question

Specify any kind of table with the table entries representing the number of points for the response. The table has to be the last element of the question section!

The `rqti` package is clever enough to transform your table into the appropriate QTI object (single choice, multiple choice, directed pair). Of course you can also just load a csv and print it as a markdown table via `knitr::kable(yourtable)`

Hint: Use visual editing mode in RStudio to quickly change your table.

|      |27|36 |25| 6 |
|------|--|---|--|---|
|4*9 = |0 |0.5|0 | 0 |
|3*9 = |1 |0  |0 | 0 |
|5*5 = |0 |0  |1 | 0 |
|2*3 = |0 |0  |0 | 1 |
|12*3 =|0 |1  |0 | 0 |

# feedback

Provide your feedback here. For tables it is difficult to provide useful feedback because there are usually many questions. But most learning management systems will at least show which answers are correct and incorrect.

Clicking the Knit-Button will produce:

Preview of table exercise rendered by QTIJS
Preview of table exercise rendered by QTIJS

Alternatively, change the knit parameter to knit: rqti::render_opal (see API Opal) to upload to opal directly, producing:

The table entries in the Rmd-file contain the number of points for the response. Any number above 0 is considered correct. You can also use negative numbers, which will reduce the points reached, but never below 0. The number of correct responses per row and column can be specified as needed. This usually has an effect on the presentation of the table. For instance, there are special tables where only one row per column is correct and where only one column per row is correct. The rqti package takes care of this automatically, so you do not need to do anything. In this regard it is important to know that if you create a table that is actually a directed pair, it will be transformed into a directed pair exercise. If you do not want this, use as_table = true in the yaml-section.

The overall points for the exercise are calculated as the sum of the positive table entries.

Of course you can also just load a csv and print it as a markdown table via knitr::kable(yourtable). Just do not forget that the table has to be the last element of the question section.

Note that in this example, a feedback section was also provided. The feedback is optional, but usually it is a good idea to give some explanation for students.

More control

If you want to have more fine-grained control, consider the Rmd template rqti: table (complex), which uses more yaml attributes.

---
type: table
knit: rqti::render_qtijs
identifier: TOPIC1_Q001 # think twice about this id for later data analysis!
title: A meaningful title that can be displayed in the LMS
shuffle_cols: false
shuffle_rows: true
abbr_id: true
---

# question

Specify any kind of table with the table entries representing the number of points for the response. The table has to be the last element of the question section!

The `rqti` package is clever enough to transform your table into the appropriate QTI object (single choice or multiple choice). Of course you can also just load a csv and print it as a markdown table via `knitr::kable(yourtable)`

Use visual editing mode in RStudio to quickly change your table.

|      |27|36 |25| 6 |
|------|--|---|--|---|
|4*9 = |0 |0.5|0 | 0 |
|3*9 = |1 |0  |0 | 0 |
|5*5 = |0 |0  |1 | 0 |
|2*3 = |0 |0  |0 | 1 |
|12*3 =|0 |1  |0 | 0 |


# feedback

Provide your feedback here. For tables it is difficult to provide useful feedback because there are usually many questions. But most learning management systems will at least show which answers are correct and incorrect.

Which, in Opal, renders as:

Preview of complex table exercise in LMS OPAL
Preview of complex table exercise in LMS OPAL

You can see that rows and columns are now fixed and there is a more meaningful title.

yaml attributes

type

Has to be table or match.

identifier

This is the ID of the exercise, useful for later data analysis of results. The default is the file name. If you are doing extensive data analysis later on it makes sense to specify a meaningful identifier. In all other cases, the file name should be fine.

title

Title of the exercise. Can be displayed to students depending on the learning management system settings. Default is the file name.

shuffle

If true (the default), randomizes the order of rows and columns. Only in rare occasions it makes sense to have a strict order of elements (setting shuffle to false). Overwrites shuffle_rows and shuffle_cols.

shuffle_rows

Only shuffle the rows. Default is true. Overwritten by shuffle.

shuffle_cols

Only shuffle the columns. Default is true. Overwritten by shuffle.

abbr_id

Defines the use of an abbreviation as a way to generate row and column identifiers. Explained in more detail in the section Managing identifiers.

Feedback

Feedback can be provided with the section

  • # feedback (general feedback, displayed every time, without conditions)
  • # feedback+ (only provided if student reaches all points)
  • # feedback- (only provided if student does not reach all points)

Managing identifiers

The identifiers of rows and columns are useful for later data analysis of results. If you are doing extensive data analysis later on, it makes sense to specify meaningful identifiers, or at least make them more recognizable.

There are currently two ways to form identifiers of rows and columns:

  1. By default rqti uses row_1row_N, col_1col_N.
  2. Using abbr_id: true in the yaml section of the Rmd file, rqti takes the first word of a row or column element and combines it with the abbreviation of the remaining text of the element. Example: for the element “Mean Value Theorem for Integrals” rqti makes the identifier “Mean_VTfI”. If the row/column starts with digits, “col”/“row” is added as prefix as identifiers are not allowed to start with a number. All special characters are removed.

We experimented with different solutions and settled on these simple versions. If you need more control of the identifiers, please open an issue on github: https://github.com/shevandrin/rqti/issues and we will reconsider the options.

Some advice on table exercises

Table exercises are forced choice exercises, so they suffer from the sample problems as single choice and multiple choice exercises. The advantage of table exercises is that they are easy so manage (e.g. in csv-tables) and many questions can be asked at once, using little space.