How to get back the user ID and object learning id

Anything about what happens on the user and teacher side
gihel
FormaLms Expert
Posts: 76
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

How to get back the user ID and object learning id

Post by gihel » Thu Oct 25, 2018 3:17 pm

Hi,
How to get back the user ID and object learning id in a page html
because I insert iframe and would like keep the information.

thank you

alfa24
FormaLms Master
Posts: 445
Joined: Fri Nov 24, 2017 8:45 am
Version: forma.lms 1.4.2

Re: How to get back the user ID and object learning id

Post by alfa24 » Thu Oct 25, 2018 3:19 pm

please explain what you're trying to obtain... make an example
I'm Jasmines, the One. If you need, you can contact me.

gihel
FormaLms Expert
Posts: 76
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

Re: How to get back the user ID and object learning id

Post by gihel » Thu Oct 25, 2018 3:51 pm

OK I try to explain.
I want an iframe with some dynamic object and The user must comment with a text .
I want to keep the information so that the teacher can analyze the answers.
I also want in the iframe page to print a summary of the work done as well as a graph.
I want to create an additional table in the database to keep the information so that at the end of the course (several learning objects) I can output a total synthesis.
To do this I need the user ID and LO ID.
I can get these information by JScript or parameters in the iframe but how to do it ?

alfa24
FormaLms Master
Posts: 445
Joined: Fri Nov 24, 2017 8:45 am
Version: forma.lms 1.4.2

Re: How to get back the user ID and object learning id

Post by alfa24 » Thu Oct 25, 2018 4:46 pm

why iframe? and what kind of application will be in the iframe?
I'm Jasmines, the One. If you need, you can contact me.

User avatar
canelli
FormaLms Guru
Posts: 488
Joined: Thu Nov 08, 2012 12:21 pm
Version: forma.lms 2.0
Contact:

Re: How to get back the user ID and object learning id

Post by canelli » Thu Oct 25, 2018 4:48 pm

why you don't try to use a standard LO of type test ?

for your object you need to develop some php pages. chek how other php use library and internals .

I you need we can develop for you the enanchement . send me a PM
Cercate nel forum le riposte prima di chiedere. Check the forum before posting
---------------
Claudio Anelli
Joint Technologies - Sistemi avanzati per l'information technology

http://www.joint-tech.com
---------------

gihel
FormaLms Expert
Posts: 76
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

Re: How to get back the user ID and object learning id

Post by gihel » Sat Oct 27, 2018 5:11 pm

OK I found the solution, I can continue my work.

cao
FormaLms User
Posts: 60
Joined: Fri Oct 12, 2018 8:32 pm
Version: forma.lms 2.0

Re: How to get back the user ID and object learning id

Post by cao » Sat Nov 10, 2018 6:39 pm

Hello gihel
This is an open forum.
There will be other people with the same issues as you, as a result the proper thing to do is to share.
I found a solution does not help other people.
thank you

User avatar
max
FormaLms Guru
Posts: 2056
Joined: Thu Mar 01, 2012 10:41 am

Re: How to get back the user ID and object learning id

Post by max » Sat Nov 10, 2018 7:26 pm

Thanks cao, this is an excellent point and I am glad it's a forum user that makes it
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
http://www.elearnit.net
http://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
http://elearnit.wordpress.com
Skype: m_ferrari_it

gihel
FormaLms Expert
Posts: 76
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

Re: How to get back the user ID and object learning id

Post by gihel » Mon Nov 12, 2018 7:09 pm

SORRY I don't think other people was interested.
I saw in the source of the page there was a field input "username"
I made a js script who find the field and pickup the val

Code: Select all

  "var nameUser=$('#username').val();"
after I call a script php with ajax and I pickup the id in the database

Code: Select all

   $utilisateur=$_POST['utilisateur'];
            //----------Recherche ID user ---------------------------
	$sql="select from core_user where userid='/$utilisateur';";
	
	$result=mysqli_query($bdd, $sql);
	$idst=0;
	if ($result){
		$ligne=mysqli_fetch_array($result);
		$cleUser=$ligne['idst'];
		echo "cleUser= ".$cleUser;
	}
I hope you like it (yes I know it's forbidden, but I am french and you are Italian, there is nothing forbidden for us)

alfa24
FormaLms Master
Posts: 445
Joined: Fri Nov 24, 2017 8:45 am
Version: forma.lms 1.4.2

Re: How to get back the user ID and object learning id

Post by alfa24 » Mon Nov 12, 2018 7:14 pm

your solution is dangerous...
I'm Jasmines, the One. If you need, you can contact me.

Post Reply