Submit assignment from an External application

Submit assignment from an External application

by Dawan Killins -
Number of replies: 7
Is there an API or web service available that would allow me to automate assignment uploads from a custom application?  Or somehow access a digital dropbox feature in moodle?
Average of ratings: -
In reply to Dawan Killins

Re: Submit assignment from an External application

by David Megill -
I use a web service to write back to my music assignment types. It can write to the gradebook as well or just to the assignment. It requires an admin account on the Moodle site. I currently call it from a Java Server.

You would need to export user, module, assignment, etc. info to the external application for use logging back into the appropriate moodle course.

If you are interested I can send you the code for the web service.

In reply to David Megill

Re: Submit assignment from an External application

by Dawan Killins -
Thanks David!  I would like to take a look at the code for your web service.
In reply to Dawan Killins

Re: Submit assignment from an External application

by David Megill -
Here is the webservice I use. It is placed in the /mod/assignment folder. It obviously looks for my music assignment type.

Hope it helps,
In reply to David Megill

Re: Submit assignment from an External application

by Alex Watterson -
Chaps,

I'm trying to do something which sounds kind of similar, but is probably a lot easier smile I'm simply trying to find out how to write a Moodle Assignment Grade from an external application. All i'm looking for is a quick and dirty way to use PHP to write an assignment grade. Do you know the easiest way to do that?

Thanks,

Alex
In reply to Alex Watterson

Re: Submit assignment from an External application

by David Megill -
You can use the same web service I posted above. You need some things in place however. You must login with an account that has permissions to grade. I actually use a administrator so I don't have to worry which course I'm writing to.

You also need to send the assignment, course, etc. out to the external application. You can then send that info back to the web service so it knows which course, assignment and student to write the grade to.
In reply to David Megill

Re: Submit assignment from an External application

by Alex Watterson -
David,

Many thanks, I shall have a look at the code and see if I can strip it down. I'm new to the Moodle thing so if I copy your Add submission.php to /mod/assignment how would I then access it?

Essentially what i'm going to do is use Moodle to call an external program via XML-RPC. I can already do this part, so I was then looking for a way to allow the external application to in some way pass a mark back to Moodle.

I thought creating a kind of offline assignment which my external app would then pass a mark back for seemed like a good way to do this?

Thanks,

Al
In reply to Alex Watterson

Re: Submit assignment from an External application

by Dawan Killins -

I'm still trying to figure out how the .php service is served up.  The docs speak of an XML-RPC dispatcher native to 1.9.  I don't understand how to invoke this functionality.  I would like to call a web service using a .NET XML-RPC library.  Does anyone have a client code snippet for invoking a service through XML-RPC?