SCM

Forum: support

Monitor Forum | Start New Thread Start New Thread
RE: Inspera [ Reply ]
By: Achim Zeileis on 2024-05-04 09:23
[forum:49901]
Apologies, Joachim, I was sick last week and now have to catch up with more urgent tasks first. I will need some more time to follow up here.

RE: Inspera [ Reply ]
By: Joachim Hansen on 2024-05-04 09:14
[forum:49900]
Hi Achim,

I'm guessing that you'll bean to busy to have a look at what I wrote.

When you have the time let me know if we should try to improve the Inspera situation.

Regards,

Joachim

RE: Inspera [ Reply ]
By: Joachim Hansen on 2024-04-22 18:45
[forum:49874]
An other interesting finding is that exams2qti21() works better than exams2inspera() when importing questions into Inspera.

With exams2qti21() I get Inspera Question Set not just loose questions as I did with exams2inspera().

And the question with the space agency (Figure 5: field_string.Rmd in the pdf document) worked after saving (the correct answer did not disappears)

RE: Inspera [ Reply ]
By: Joachim Hansen on 2024-04-22 14:23
[forum:49873]
What is interesting is, if I open the question (in Inspera) about the space agency (Figure 5: field_string.Rmd in the pdf document) the answer disappears and I need to set the answer (NASA) and save the question before it works.

But with the addition question (Figure 7: calculation_num.Rmd in the pdf document) I just need to open and save the question for it to work (no clicking in the field where the answers goes or anything).

RE: Inspera [ Reply ]
By: Joachim Hansen on 2024-04-22 12:54
[forum:49871]

inspera_import.pdf (2) downloads
Hi Achim,

It would appear that there are a few things that needs to be tweaked in order to get Inspera to work with exams generate by R/Exams.

Have a look attached pdf file.

How should we tackle this? Should we start with getting Inspera to recognize exams (what Inspera calls Question sets) with multiple questions in it (not just lose questions)?

How should we go about it?

E.g. I could correct the questions in Inspera (make them work) and export the QTI21 code, or I could recreate the questions from scratch in Inspera and export them (not sure if this would generate cleaner QTI code)?

I think it would make sense to work with an slimed down exam with only two question in order to minimize generated QTI code.

I have created 5 simple question that I will be reusing.

1. Single choice (schoice)
"one_schoice.Rmd", ## knowledge quiz question about animal that is not a mammal

2. Multiple choice (mchoice)
"several_mchoice.Rmd", ## knowledge quiz question about letters and numbers

3. Short text string (string)
"field_string.Rmd", ## exact field string question naming space agency

4. Essay text string (string, essay)
"essay_string.Rmd", ## short essay rich text question

5. Numeric exercises (num)
"calculation_num.Rmd" ## calculation question about adding two numbers

Joachim

RE: Inspera [ Reply ]
By: Achim Zeileis on 2024-04-20 15:33
[forum:49866]
Joachim, ok, great! Thanks again for looking into this.
Best wishes, Achim

RE: Inspera [ Reply ]
By: Joachim Hansen on 2024-04-20 07:47
[forum:49864]
Hi Achim,

Sorry for the late answer (the reason being I could not use my normal yahoo.com email address when I signed up here as https://r-forge.r-project.org/ never sent me an email so that I could confirm my account and I hade to use my lesser used Hotmail address that I don’t check so often).

No need to worry, I’m not feeling hurt about you not taking on my Inspera ideas. I’m not even sure if trying to make a “better” Inspera export is warranted or needed. I’m manly trying to learn R, RStudio, Quarto rmarkdown etc. so that I can help my partner that works at the university (where they use Inspera and Canvas). My thinking is that I want to learn to program and maybe I could find a project I could contribute to in the future if and when I know enough R programing.

So fare I have only tried a few things like importing essay and single choice questions from r-exams, I’ll have a look at what works (schoice, mchoice etc.)and how well it works and get back to you.

Joachim

RE: Inspera [ Reply ]
By: Achim Zeileis on 2024-04-19 07:53
[forum:49862]
Joachim, thanks again for the time you invested into improving the Inspera support for R/exams - and apologies for not following all of your suggestions. I hope it didn't come across as unfriendly or unwelcoming.

In order to not let all your efforts go to waste, I wanted to follow up here and ask:

- Are the improvements we implemented in exams2inspera() for "num" and (standard) "string" exercises sufficient for importing these correctly in Inspera now?

- My understanding is that "schoice" and "mchoice" already worked correctly before, right?

- Do "essay" stringtype questions also work correctly - except for the title of the editor box? And if so, why do you think it is critical to use this title as opposed to the general question text?

In any case, any feedback you can provide on these questions is appreciated. If you don't have time for it at the moment, that's perfectly fine as well - don't feel obliged.

Thanks & best wishes, Achim

RE: Inspera [ Reply ]
By: Achim Zeileis on 2024-04-14 12:51
[forum:49859]
Thanks for this, Joachim! But why do you think it would be important to set this field? Isn't it sufficient to just put all instructions into the regular question text of the exercise? Then we don't need any special variables etc.

RE: Inspera [ Reply ]
By: Joachim Hansen on 2024-04-14 12:31
[forum:49858]
I managed to replace the hard coded Inspera essay rich text box text (the title field of the rich text box) with a variabel that is read from the questions Meta-information (added my own field for testing purpose). So if there is no meta information the variable is empty and not showen.

The code might not be as sleek as it could be but I would gladly upload it if it can be use as inspiration for Inspera addition.

RE: Inspera [ Reply ]
By: Joachim Hansen on 2024-04-12 10:04
[forum:49857]
Hi Achim,
I do understand the more general/pragmatic approach you are taking since R/exams should work for as many LMS as possible.

My intention was never to use a hard coded strings more as a starting point for code that could be used with Inspera. My thinking was the string above the rich text box could be empty by default and read in from the meta information in the question if available. Maybe the “Meta-information” capabilities could be expanded in the future or the exextra[]: parameter could be used.

I have found that I can read the exextra[]: parameter in e.g. exams2qti21.R (read_metainfo.R) and pick it up with my own code but I have not found an example where the data read from exextra[] is being used in any printout or imported (maybe I have misunderstood something).

I will see if I can find the time to learn more R in order to have a better understanding how R/Exams works.

Thanks, I appreciate the feedback you have given me up till now.

Joachim

RE: Inspera [ Reply ]
By: Achim Zeileis on 2024-04-10 00:29
[forum:49856]
Thanks, Joachim, very much appreciated!

I had already added the format="xhtml" attribute yesterday. This is only enabled in exams2inspera(...) or exams2qti21(..., flavor = "inspera").

I'd rather not add the hard-coded <prompt> because different users will want different texts here, in particular using different languages. So I would omit this and rather recommend to put thins intruction into the main question text.

Regarding the expectedLength. I haven't hard-coded the 20 but rather use 20 as the minimum length. The idea is that the length of the entry field should not convey any information about the length of the solution. Otherwise this might help with educated guessing of potential solutions. I'm happy to discuss this though.

RE: Inspera [ Reply ]
By: Joachim Hansen on 2024-04-09 10:31
[forum:49855]
Regarding line 795, my thinking was that the length of the answer string could be determined (if I remember correctly the answer was -0.111 so expectedLength should be 6) and added to Insperas field expectedLength= instead of the static number 20 that you added.

RE: Inspera [ Reply ]
By: Joachim Hansen on 2024-04-09 10:23
[forum:49854]

essayquestion.pdf (5) downloads
Achim, thanks for answering my questions.

When essay questions (intended for manually grading) are created in Inspera with default values they have attributes that are missing when the question is imported from R/Exams generated question. I have attached a pdf file where you can see the differences between question created in Inspera and one that is imported.

Missing is the text above the rich text box where the answer goes, the default text Inspera insert is "Fill in your answer here" (I guess this text should be read from the question).

This is what the Inspera qti21 code looks like(exported from Inspera):
...
<itemBody>
<p>Replace with question text</p>
<extendedTextInteraction autosave="15" expectedLength="0" format="xhtml" responseIdentifier="RESPONSE">
<prompt>Fill in your answer here</prompt>
</extendedTextInteraction><p class="blockInteraction"/>
</itemBody>
...


And this is the code I put in my exams2qti21.R (in proximity to line 982)

if(!upfile[i]) {
paste('<extendedTextInteraction', if(!copypaste) ' class="essay-nocopypaste" ' else ' ',
' format="xhtml" ', # Added this to get rich text box instead of plain text
'responseIdentifier="', ids[[i]]$response,
'" minStrings="0" ', if(!is.na(maxchars[[i]][1])) {
paste0(' expectedLength="', maxchars[[i]][1], '"')
} else NULL, if(!is.na(maxchars[[i]][2])) {
paste(' expectedLines="', maxchars[[i]][2], '" ', sep = '')
# } else NULL, '/>', sep = '') # removed close /, moved sep = '') to the end and added full '</extendedTextInteraction>' later to close
} else NULL, '>',
'<prompt>Fill in your answer here</prompt>',
'</extendedTextInteraction>',
'<p class="blockInteraction"/>',
sep = '')
}

I cleaned up the code so I hope I did not introduce any mistakes.

This code works for me, it gives an Inspera essay question that looks like the one generated by Inspera. The problem is that the text "Fill in your answer here" is static (and potentially dose not reflect the correct language used).

RE: Inspera [ Reply ]
By: Achim Zeileis on 2024-04-08 23:41
[forum:49853]
Concrete code changes:

In line 962 I had already made a change for the num exercises following your SO post.

In line 982 I added now the format="xhtml" attribute for the string exercises.

In line 795 I'm not sure how the XML needs to be different for Inspera.

RE: Inspera [ Reply ]
By: Achim Zeileis on 2024-04-08 23:38
[forum:49852]
Joachim, first of all thank you for taking the time to post here, this is very much appreciated! And apologies for not responding sooner, I was traveling last week.

Second, for a general introduction: I'm indeed the person who started the R/exams project (almost 20 years ago) and I'm the maintainer and principal author - but by no means the only one. In particular, for the QTI 2.1 (and Moodle XML) interfaces my colleague Nikolaus Umlauf wrote most of the code.

Then let's start with your concerete questions:

(1) Yes, this kind of reverse engineering is what we have done for other interfaces as well. The general QTI 2.1 standard is very broad and flexible (see http://www.imsglobal.org/question/qtiv2p1/imsqti_implv2p1.html) but the different learning management systems are somewhat idiosyncratic in which tags/attributes they want to have set and which are ignored or lead to errors. So we started out with a first implementation following the general guidelines from IMS Global linked above and tested that with the OpenOlat learning management system which in turn relies on a rather general QTI implementation called QTIWorks. Subsequently, we made certain small tweaks for flavor = "ans" or flavor = "inspera".

2. For exams2moodle it was quite clear that we needed a completely different interface because it uses a completely different XML standard (Moodle XML). But for exams2ans and exams2inspera it seems that we don't need to fork the entire code but it seems that certain small fixes will be sufficient. We took a similar approach for exams2qti12 (note 12 not 21) and exams2canvas and exams2ilias for example.

3. I agree that the code could be more modular with more comments but I'm afraid that this won't change substantially very soon. However, you should not feel obliged to go through the entire code to make contributions here. If you can provide us with reverse engineering insights, we can also help with going through the code. For example, you might say something like:

- I generated a string exercise via:

set.seed(0)
exams2inspera("countrycodes.Rmd")

- And then I had to change line XY from ... to ... in order to import it successfully into Inspera.

- If you have an idea where in the code we need to make a change, that's great and definitely useful. But don't feel obliged to pinpoint this exactly.

Thanks again & best wishes, Achim

RE: Inspera [ Reply ]
By: Joachim Hansen on 2024-04-08 18:26
[forum:49851]
Hi Achim,

From what I can see it would appear that you are the main contributor and founder of R/exams so I’ll try to ask you a few questions (I hope that is ok by you).

I am trying to make R/exams work with Inspera and I have some success making small changes to exams2qti21.R that exams2inspera.R uses to generate the zip file that is imported into Inspera. E.g. I have managed to add rich text (set the mode of the input box in Inspera to rich text instead of plane text by adding ' format="xhtml" ') when the question is of essay type with manual grading.

Changes made to line 981 exams2qti21.R
paste('<extendedTextInteraction', if(!copypaste) ' class="essay-nocopypaste" ' else ' ',
' format="xhtml" ',
……

I tried to import countrycodes.Rmd into Inspera (exams2inspera("countrycodes.Rmd", name = "testcountrycodes")), the question imports ok but it dose not bring over the correct answer (e.g ESP for Spain) so this needs to be entered manually. If I export the question from Inspera in qti21 format and compare it to the qti code generated by R/exams I see that they are quite different.

I also see that moodle has it own file (exams2moodle.R) instead of relying on exams2qti21.R uses.

My question to you are:

1. What would be the best way to reverse engineer Insperas qti format? Is exporting from Inspera and mimicking the code it generates the best way or should one try to follow the qti21 standard?

2. When would it make sense to create a exams2inspera.R that does not relay on exams2qti21.R (like exams2moodle.R)?

3. This is a big ask, any chance you could add more comment in the exams2qti21.R code? I ask as I am a beginner and I find it hard to figure out what is going on.

Kind Regards

joachimh

Inspera [ Reply ]
By: Joachim Hansen on 2024-04-03 14:25
[forum:49850]
Achim, thanks for taking the time to answer my question on stackoverflow.com!

I found r/exams and cloned the svn repository locally and I managed to build it and make it work in RStudio despite not nearly knowing enough about programming in r.

I hade a look at exams2inspera.R and exams2qti21.R that I think you made changes to in order to add the Inspera expectedLength parameter.

I can see where you made the change to add expectedLength (line 962) and where I might be able to read the answer length from the question (line 795) in order to set the length of expectedLength dynamically (based on the correct result in the questions Meta-information exsolution field).

exams2qti21.R (Revision 2626)
795 sprintf('<value>%s</value>', solution[[i]]),
962 if(flavor == "inspera") sprintf(' expectedLength="%s"', pmax(ceiling(1.2 * nchar(format(x$metainfo$solution))), 20)) else ''),


I’ll probably will need to learn more r before I make an other post here.

joachimh (yoggi)

Thanks to:
Vienna University of Economics and Business Powered By FusionForge