shevandrin / rqti

Create QTI Exercises and Exams from R
https://shevandrin.github.io/rqti/
GNU General Public License v3.0
5 stars 2 forks source link

upload2opal with overwrite = F should not ask again on command line #84

Closed johannes-titz closed 1 year ago

johannes-titz commented 1 year ago

Trying to upload several exercises again to get the URL, setting overwrite = F still asks me for each file what I want to do.

shevandrin commented 1 year ago

lets specify this scenario with overwrite values:

  1. if overwrite = TRUE and only one resource with given display_name is found - qti just overwrites it, without any interactions with user. If there are more than one resources with given display name - qti asks user what to do.
  2. if overwrite = FALSE - it always adds new resource? or?

@johannes-titz what is your vision?

johannes-titz commented 1 year ago

Sorry, the semantic of overwrite is more complicated than I thought. Actually the problem is located elsewhere. For the vignettes I uploaded all exercises and templates to opal, then made the screenshots. Now, it would be nice to have some way of getting the urls of the files without uploading them again (this takes time). Basically the functionality is to just to check if a file exists on OPAL and return the url. I think we tried that with the api and it did not work, right?

shevandrin commented 1 year ago

Which attribute of resource on Opal should we use to check its existence and building an url? There are two possible:

  1. display_name: pro: user can assign and know it cons: not unique
  2. resource key: pro: unique cons: user usually don t know it, to get value for user means some additional actions on opal

probably we can make for both cases, but how multiple records in first case should be processed? build url for all records associated with given display_name?

johannes-titz commented 1 year ago

For the vignettes version 1 is better. My idea is to add opal links to the examples so the user can see and test it. In this case I only have the display_name. Duplicates can be listed; I try to avoid them anyway.

But could we also have a function that returns all resources without providing a name/key? I think we tried this and it did not work, right?

shevandrin commented 1 year ago

we tried, but failed. I am going to try again

johannes-titz commented 1 year ago

I think the problem is on OPAL's side, so we should report it to them.

shevandrin commented 1 year ago

try fetch_resource_url(display_name) to build urls

shevandrin commented 1 year ago

But could we also have a function that returns all resources without providing a name/key?

it is possible. Not possible to get data about a resource by its name/key. I will export this function.

shevandrin commented 1 year ago

try get_resources() to get list of all your resources from Opal

johannes-titz commented 1 year ago

Very nice work. Both functions produce expected results so far. I will give it some more testing. Maybe get_resource_url instead of fetch? Or is there a specific difference between get and fetch? We probably need to discuss the function names in general and how this can be extended, if other LMS are included. Maybe OOP again?

"Not possible to get data about a resource by its name/key". Does this mean we can only get the URL by display_name?