matrix_to_schoice(x, y = NULL, lower = FALSE, name = "a", delta = 0.5, digits = 0)
matrix_to_mchoice(x, y = NULL, lower = FALSE, name = "a", comparisons = c("==", "<", "="">", "<=", "="">="))=",>",>
det_to_schoice(x, y = NULL, range = NULL, delta = 0.5, digits = 0)
matrix_to_schoice
returns a list with the following components:
correct
solution,matrix_to_mchoice
returns a list with the following components:
correct
solution,det_to_schoice
returns a list with the following components:
correct
solution,matrix_to_schoice
can be used for generating a single-choice
question list for a correct result matrix x
. One element is picked
randomly from the matrix and chosen to be the correct solution. Other values
from the observed absolute range are used as wrong solutions by default
(if y
does not provide an alternative list of potential solutions). The function matrix_to_mchoice
can be used for generating a multiple-choice
question list for a correct result matrix x
. Each item from the question
list is a logical comparison of one matrix element with a comparion value.
By default the comparisons are picked randomly from the observed absolute range
(unless y
specifies a different list of comparisons).
The function det_to_schoice
can be used for generating a single-choice
question list for the determinant of a 2x2 matrix. It has been optimized
for matrices with single-digit integer elements. It may not yield very
balanced random solutions for other scenarios.
num_to_schoice
A <- matrix(c(-9, 0, 5, -2), ncol = 2)
matrix_to_schoice(A)
matrix_to_mchoice(A)
det_to_schoice(A)
B <- matrix(1:9, ncol = 3)
matrix_to_schoice(B)
matrix_to_mchoice(B)
Run the code above in your browser using DataLab