How to get back the user ID and object learning id

Anything about what happens on the user and teacher side
gihel
FormaLms User
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 »

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
Senior Boarder
Posts: 920
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 »

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 User
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 »

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
Senior Boarder
Posts: 920
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 »

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: 490
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 »

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 User
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 »

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 »

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: 2349
Joined: Thu Mar 01, 2012 10:41 am
Version: forma.lms 2.4
Contact:

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

Post by max »

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
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it

gihel
FormaLms User
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 »

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
Senior Boarder
Posts: 920
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 »

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

Post Reply