General developer forum

Displaying data from other database

 
Picture of Anton Hollands
Displaying data from other database
 

Is it possible to display data from a database that is not in the vanilla moodle? More specific, if have another web application (Security Shepherd) where student can perform various tasks which they get scored for automaticaly. The admin or teacher on Moodle should be able to view userscores and usernames from the Security Shepherd application or database.


I hope that my question is clear and I would be grateful if someone could help me out. Thank you smile


Ps: I'm a college student doing an internship. (this question is related to my internship assignment)

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Displaying data from other database
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

Are you able to modify Securiy Shepherd? If so, one approach would be to modify it to support the LTI (learning tools interoperability) standard. That makes it easy to link to the tool from systems like Moodle, and then Security Shepherd can pass grades etc back to Moodle.

http://www.imsglobal.org/activity/learning-tools-interoperability

If that is not possible, there is probably a hackier method that can be made to work.

 
Average of ratings: -
Picture of Anton Hollands
Re: Displaying data from other database
 

Thank you for your response.

In theory, yes, I am able to modify Security Shepherd. The thing is that Security Shepherd is very complex and was written in Java. So it would take me much longer then the time of my internship to learn the Security Shepherd code.


I think I will specifiy my question a bit. So, I want usernames and userscores from the Security Shepherd databank (which I have access to) being displayed in Moodle. (This can just be an extra page and does not necessarly have to connected to a Moodle useraccount). In an ideal scenario the user from Moodle and Security Shepherd are interconnected, but I'm afraid I won't have the time for that.

Another solution is to have a quiz in Moodle where users just answer a few questions about Security Shepherd. One of the questions would be: "Choose your username and score from the list with which you practised in Security Shepherd." --> This way the quiz is used as some sort of survey and the teacher and admin get a nice overview.


I hope my question is clear and that you are able to help me. I have a limited time in completing this part of my internship so if it is not possible, just tell me and I will talk with my supervisor about it.

Thanks in advance!

 
Average of ratings: -
Sketch...
Re: Displaying data from other database
Group Particularly helpful Moodlers

So all you want is to have a page in Moodle where you display the "usernames and userscores from the Security Shepherd databank"?

And you don't want to do anything else with that Security Shepherd data in Moodle?

Without more details, I would create a local plugin in Moodle that gets the data from the Security Shepherd database and displays it in a table in Moodle. https://docs.moodle.org/dev/Local_plugins

Or, have you tried the Database_activity ?

 
Average of ratings: Useful (1)
Picture of Anton Hollands
Re: Displaying data from other database
 

The best would be a complete interaction between the two platforms (with shared logins and gradings), but since my internship is almost ending I will not have the time for that anymore.

I now just managed to make a block where I display the information I want (Hurray!), but I will definitely take a look at your suggestions for Local_plugins and the Database_activity!

Thank you very much :D

----------

Ps: Do you have suggestions for the quiz-part where a user can choose from a dropdownlist which is filled with external database content? 

 
Average of ratings: -
Sketch...
Re: Displaying data from other database
Group Particularly helpful Moodlers

If you got it working as a Block then you don't need a Local plugin.

 
Average of ratings: Useful (1)
Tim at Lone Pine Koala Sanctuary
Re: Displaying data from other database
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

Well, if you are able to get the scores, and display them in a block, then the next step would be be to automatically insert them into the gradebook. You don't need a quiz for that. You can just use the gradebook API.

First, you need to find the grade_item to use (and, if it does not already exist, create it automatically). Then, set the grade for each user.

 
Average of ratings: Useful (2)
Picture of Anton Hollands
Re: Displaying data from other database
 

Tim, your suggestion is good but I don't know which user from Security Shepherd corresponds with what user in Moodle. It is the users own responsibility to choose the same username (I know this is not user friendly, but at the moment it is my last resort)

But still, I might look into that when I finish the remaining assignments at my internship. My coach is happy for the moment with the way that I designed it.

Thank you very much! big grin

 
Average of ratings: -