This function defines a feedback page for an adaptive test created with psychTestRCAT, plotting the participant's results against the results of previous participants.

cat.feedback.graph(
  test_label,
  text_finish = if (!i18n) "You finished the test!" else "you_finished",
  text_score = if (!i18n) "Your final score:" else "your_score",
  text_rank = if (!i18n) "Your rank compared to previous participants:" else
    "your_rank",
  x_axis = if (!i18n) "Score" else "score",
  y_axis = if (!i18n) "Count" else "count",
  next_button = NULL,
  digits = 3L,
  explain_IRT = !i18n,
  i18n = FALSE,
  dict = psychTestRCAT::ptrcat_dict
)

Arguments

test_label

(Character scalar) Identifying label for the test (e.g. 'mdt'), used to identify the file where participant results are accumulated.

text_finish

(Character scalar) Text to display to the participant, defaults to "You finished the test!".

text_score

(Character scalar) Text to prefix to the participant's score, defaults to "Your final score:".

text_rank

(Character scalar) Text to prefix to the participant's rank, defaults to "Your rank compared to previous participants:".

x_axis

(Character scalar) Label for the x-axis, corresponding to participant scores; defaults to "Score".

y_axis

(Character scalar) Label for the y-axis, corresponding to the count of participant scores; defaults to "Count".

next_button

(NULL or a character scalar or an object of class "shiny.tag") If NULL, no next button is shown (typically because the test has completed). Otherwise, a button to progress to the next page is created, displaying the content of this argument.

digits

(Integerish scalar) Number of digits to which participant scores should be rounded.

explain_IRT

(Logical scalar) If TRUE, the feedback page includes an academic explanation of item response theory. Currently only English language is supported.

i18n

(Logical scalar) Whether internationalisation should be enabled. Defaults to FALSE to preserve back-compatibility.

dict

Internationalisation dictionary (see i18n_dict).

Value

A test element (or, if i18n is TRUE, a timeline segment) suitable for inclusion in a psychTestR timeline directly after adapt_test.

Details

Each time that this page is seen by a participant, the participant's score is written to a text file in psychTestR's output directory. This text file is used to build the population distribution for the feedback graph, once sufficiently many people have taken the test.