swirldev / swirl

:cyclone: Learn R, in R.
http://swirlstats.com
Other
1.14k stars 599 forks source link

Swirl doesn't accept answers which are S4 classes or class methods #897

Open combiz opened 2 years ago

combiz commented 2 years ago

For example with the question:

- Class: cmd_question
  Output: Use the SummarizedExperiment::assayNames() function to obtain a list of assay names for your sce.
  CorrectAnswer: omnitest('SummarizedExperiment::assayNames(sce)')
  Hint: You can load the SummarizedExperiment package using library(), or preface the function with the package namespace.

Results in: -

r$> SummarizedExperiment::assayNames(sce)
[1] "counts"
Error in testResponse.default(e$current.row, e) : 
  BUG: There are no tests for this question!

| Leaving swirl now. Type swirl() to resume.

The result is the same with or without the namespace prefix.

Any ideas? Would be very useful for a class next week :). Thanks.