Moodle

Extend import plugins to support web access

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9
  • Component/s: Gradebook
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

Like, MDL-10984, this could be part of the base class so all import plugins get it if they want to, but if this is hard then all we need for 1.9 is for the XML import plugin to have it.

Firstly, the file picker needs to have an extra field added under it as an alternative, where you can paste in a URL to a file which is on the web somewhere. (Most likely this will be an export like MDL-10984)

If this is selected, then there should be additional options:

Import this file regularly: [X]
Every day at: [14]:[30]
Send notifications of problems to: [ martin@example.com ]

Then there would be a cron() hook in grade/import/xml that keeps track of the time with plugin config variables and runs it at the correct time ... and there needs to be a loop written in grade_cron() in gradelib.php to search for and call these cron functions in all the export and import plugins.

Now, we assume that everything is set up correctly. If the incoming data does not have a matching idnumber or userid then we simply ignore it and report the problems to the given email address. Otherwise the data should be inserted as a normal file upload would.

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

Was there any progress with this?

Show
Martin Dougiamas added a comment - Was there any progress with this?
Hide
Petr Škoda (skodak) added a comment -

Starting tomorrow morning...

Show
Petr Škoda (skodak) added a comment - Starting tomorrow morning...
Hide
Petr Škoda (skodak) added a comment -

sending latest patch - I have decided to make a separate plugin for xml imports from url, the rest of import needs a minor rewrite IMHO...

Show
Petr Škoda (skodak) added a comment - sending latest patch - I have decided to make a separate plugin for xml imports from url, the rest of import needs a minor rewrite IMHO...
Hide
Petr Škoda (skodak) added a comment -

should be fixed, the cron is not part of the solution - but the url with key may be used in normal cron scripts

Show
Petr Škoda (skodak) added a comment - should be fixed, the cron is not part of the solution - but the url with key may be used in normal cron scripts
Hide
Martin Dougiamas added a comment -

Hmm, a new plugin is not what I asked for and further confuses the interface.

1. Why not implement the URL as an alternate way of specifying the file in ALL import plugins? (even just for a manual import).

2. I realise storage and management of cron jobs is a bit tricky, but can you at least implement a URL for the import (exactly like export with the key) that includes the URL for the source? That way an external cron can call it.

Show
Martin Dougiamas added a comment - Hmm, a new plugin is not what I asked for and further confuses the interface. 1. Why not implement the URL as an alternate way of specifying the file in ALL import plugins? (even just for a manual import). 2. I realise storage and management of cron jobs is a bit tricky, but can you at least implement a URL for the import (exactly like export with the key) that includes the URL for the source? That way an external cron can call it.
Hide
Petr Škoda (skodak) added a comment -

2. it is possible to use the url with private user key

Show
Petr Škoda (skodak) added a comment - 2. it is possible to use the url with private user key
Hide
Petr Škoda (skodak) added a comment -

1. the current import code in other plugin was not designed to accep parameters from url - I would have to rewrite it completely - that is why I decided to write a new plugin instead (it was much faster), now I am trying to fix only critical bugs in other import plugins

Show
Petr Škoda (skodak) added a comment - 1. the current import code in other plugin was not designed to accep parameters from url - I would have to rewrite it completely - that is why I decided to write a new plugin instead (it was much faster), now I am trying to fix only critical bugs in other import plugins
Hide
Petr Škoda (skodak) added a comment -

The new plugin is enabled for administrator by default only, normal teachers do not see it - I hope this solves the confusion problem.

Show
Petr Škoda (skodak) added a comment - The new plugin is enabled for administrator by default only, normal teachers do not see it - I hope this solves the confusion problem.
Hide
Petr Škoda (skodak) added a comment - - edited

I have reviewed the code in normal xml plugin, if we drop the preview and encoding we could use the same form+plugin for both xml and xmlurl => merge them back into one plguin using the code from newer xmlurl.

Do you want me to do it? Should be easy I guess.

Show
Petr Škoda (skodak) added a comment - - edited I have reviewed the code in normal xml plugin, if we drop the preview and encoding we could use the same form+plugin for both xml and xmlurl => merge them back into one plguin using the code from newer xmlurl. Do you want me to do it? Should be easy I guess.
Hide
Petr Škoda (skodak) added a comment -

reclosing - please reopen again if any other changes required...

Show
Petr Škoda (skodak) added a comment - reclosing - please reopen again if any other changes required...

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: