Forum: support


RE: length of exclozetype does not match length of exsolution [ Reply ] By: Martin Spott on 2025-08-18 14:38 | [forum:50101] |
Thanks Achim, I am currently away, but will test it, when I am back in September. Martin |
RE: length of exclozetype does not match length of exsolution [ Reply ] By: Achim Zeileis on 2025-08-11 15:17 | [forum:50100] |
Martin, I have now added a workaround in the current version of "exams" on R-Forge. This isn't perfect, yet, but it should at least properly handle your case. Could you please try to install the current development version: install.packages("exams", repos = "https://R-Forge.R-project.org") and check whether this handles your exercises correctly? |
RE: length of exclozetype does not match length of exsolution [ Reply ] By: Achim Zeileis on 2025-07-31 21:53 | [forum:50097] |
I think there was a reason for not using this design. I will discuss this with my co-author, Reto, woho added this feature. But it will have to wait until after the vacation, I think. I hope you could work around it for your exam? Just for the record: The grepl() causing this is in line 78 (Rnw) and 98 (Rmd) of read_metainfo.R |
RE: length of exclozetype does not match length of exsolution [ Reply ] By: Martin Spott on 2025-07-30 11:20 | [forum:50096] |
Thanks for the quick response! Couldn't you just allow to use [double] quotes around strings in exsolution, i.e. exsolution: "he(l)lo"|"t(e)st" in my example? I am sure you had considered this already ... :-) Thanks, Martin |
RE: length of exclozetype does not match length of exsolution [ Reply ] By: Achim Zeileis on 2025-07-29 20:01 | [forum:50095] |
Thanks for the report, this is a bug. Apparently, it was introduced when we added support for regular expressions in string exercises: <q> In exsolution the | can now not only be used as the separator symbol for multiple solutions in a cloze exercise but additionally within the solutions. This is useful for example when the answer string is a regular expression. In this case the | has to be within round brackets (and possibly ^ and/or $), e.g., exsolution: ^(OLS|ML)$|01001. This gets interpreted as two elements with values ^(OLS|ML)$ and 01001. </q> The bug seems to be that it can deal with both hello|t(e)st he(l)lo|test but not he(l)lo|t(e)st because the reader seems to think that the | is within round brackets. We will discuss how to best tackle this... |
length of exclozetype does not match length of exsolution [ Reply ] By: Martin Spott on 2025-07-29 16:05 | [forum:50094] |
Hi Achim, I ran into trouble when recompiling a cloze question, suddenly producing the error "length of exclozetype does not match length of exsolution". I believe it did work earlier this year. I narrowed it down to round parentheses in string solutions, but it actually requires pairs of round parentheses in at least two string answers. I put together a simple example to demonstrate the problem, please see below. If you remove the parentheses from "t(e)st", it compiles without any problems. I tried all sorts of things with escaping, quotes etc. but nothing worked. I will use a quick work around for the coming exams by using square brackets, but it would be nice to be able to use round ones (in my case for mathematical equations). I am using a development version of exams since earlier this year, when you fixed a bug for me (see https://r-forge.r-project.org/forum/message.php?msg_id=50064&group_id=1337). Since I am preparing an exam on 31/07 I did not want to risk switching to a newer version. Best regards, Martin >>>> Question ======== temp \#\#ANSWER1\#\# \#\#ANSWER2\#\# Answerlist ---------- * * Meta-information ================ extype: cloze exsolution: he(l)lo|t(e)st exclozetype: string|string exname: wahrscheinlichkeiten extol: 0.05 exextra[numwidth,logical]: TRUE |