Database Interaction

Create unique Flash widgets you can import into SmartBuilder

Moderator: Nav

Database Interaction

Postby aprilsheninger » Mon Mar 14, 2011 7:20 am

Hi.

We are working on the database interactions for the module that I am working on right now. In the past, we have only needed to pass maybe one bit or two bits of info back and forth. This module is different and I am working with a different programmer. I knew what he was asking wasn't some that I've done and couldn't find anything in the Forum, but I told him I'd ask if it was possible. We don't have an LMS, we use a fairly straightforward database.

From Paul:

First, is it possible through the use of URL calls to return information to the SmartBuilder application which can then be stored in variables and made available throughout the life of the application? For example, we would call a url that would return the gender of an individual which could be stored in the application, so no matter what stage the user is in we would know the gender of that particular user.

Building on top that, is it possible for us to return multiple pieces of information through a URL call and using a parsing function provided by SmartBuilder to parse that information out for future reference within the application.

Thank you,
April
aprilsheninger
 
Posts: 68
Joined: Tue Mar 18, 2008 8:51 am
Location: State College, Pa

Re: Database Interaction

Postby Nav » Mon Mar 14, 2011 4:13 pm

Hi Paul and April,
You can return information to SmartBuilder. You would need to use the Server Communication object, which is different from the URL Data object. Please find more information here, including an example - http://help.smartbuilder.com/node/212

As for your second question... maybe.

The simplest solution (not necessarily the least effort) would be to request different information with different URL calls. If you only have a couple pieces of data (e.g., gender, age, etc), you could load it in to SmartBuilder one at a time, and store for the session in a Variable.

A better idea, if you have lots of data, might be to exapt* a new feature to SmartBuilder. You can store and retrieve variables in SmartBuilder now. Basically, the idea is SmartBuilder can convert all it's Global Variables into a string. This string can be sent to an LMS or a database. Then the string can be retrieved at a later session (or whatever), and loaded back into the SmartBuilder Global Variables. Now, if you were to change some of those values along the way, you could potentially influence multiple variables at once.

Please email if you want to pursue this second path. We can do an online meeting and I can show you a little more about what to do.

- Nav
Nav
 
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm

Re: Database Interaction

Postby aprilsheninger » Thu Mar 31, 2011 11:23 am

Hi Nav,

This is a more precise question than the last one. I need to be able to store a GUID (random number that IDs a user) and then use it at various points within the module to tell the database which user's info it is. So the student logs in using their uerid and password and is assigned a GUID in the database that is used to identify them for the rest of the module. We need this so a student can't change the URL of their custom report to fill out questionnaires or see the final reports of other students. It's a security (HIPAA, FERPA issue. The database that Paul created is much more robust than the ones we've had before because 14000 will start hitting this module starting in May. A nice little flat database just couldn't handle it. So he created a series of stored procedures and tables to store everything. Basically, at 10 places in the module, I am sending the GUID to various URLs to update the database. I am used to sending the name of the field and a value, so this is different I think or maybe it isn't and I am just a little confused because it looks different from other Actions I have created. I think I need help understanding how to store the GUID. I understand how to send values, but it just doesn't seem like the right student's file would be updated. I set up Global Variable for all of the values that I need to send, but then read over the link that you sent me and it looks like I need parameters instead or in addition to them? I don't think I've used those like this before. I am so confused. Help!

It's the same course that I've been working on-PSUSAFE.

Thank you,
April
aprilsheninger
 
Posts: 68
Joined: Tue Mar 18, 2008 8:51 am
Location: State College, Pa

Re: Database Interaction

Postby aprilsheninger » Mon Apr 04, 2011 12:07 pm

Updated info related to my question:

I set up the Parameter pairs for each question using the Server Communication action. I am not sure whether to use the Send to URL under the Server Communication action or to go with the SDK Object to actually send the info to my database. For whatever reason, this part doesn’t make much sense to me. I am not sure how to “gather them up” to send them if that makes sense. Do I do them one at a time or as a long string? Do I separate using commas, spaces, semicolons if it is a string?

The version of the module that is the most up to date is PSUSAFEPilot.

Thank you,
April
aprilsheninger
 
Posts: 68
Joined: Tue Mar 18, 2008 8:51 am
Location: State College, Pa

Re: Database Interaction

Postby Nav » Wed Apr 06, 2011 10:52 am

Just to close off this discussion for anyone following it...

We had to do a gotomeeting to determine the best way to send the data for each case. The general idea was we asked a script for the ID, and then stored that in a Global Variable. Then we generated URLs using Text Variables

Local Variable > URLstring > setValue = example.com/survey/
Local Variable > URLstring > append > Function > Global Variable > ID > getValue

would result in "example.com/survey/7984984",

or we used Server Communication > setParamater (if the task called for it), and sent that info off to the database. Or retrieved info. There were several different cases.

- Nav
Nav
 
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm

Re: Database Interaction

Postby aprilsheninger » Wed Apr 06, 2011 11:11 am

I am hoping to test this starting tomorrow. I'll let everyone know how it works out.

Thanks again, Nav, for spending the time with me. It was very educational and incredibly helpful.

April
aprilsheninger
 
Posts: 68
Joined: Tue Mar 18, 2008 8:51 am
Location: State College, Pa


Return to Using the Object SDK

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Not able to open ./cache/data_global.php