|
hi..
i'm very new in using java script. i just want to know how to code for my problem. i want to drag a picture to a box given and mark will be calculated if the user drag to the correct box.
what should i do. please help me
|
|
|
Since you are starting at the very beginning of this learning journey, try to find a website that does this. I suggest you search for HTML Drag & Drop on Google. I did this and found several website including these two.
Here is one site that is designed to help you accomplish your goal: http://javascript.internet.com/page-details/drag-n-drop.html
Here is one website that offers image drag & drop. You could steal (um, leverage) the javascript from here. http://www.bunnysneezes.net/page16.html
Don't ask me what this website is above! I'm not endorsing it. I'm just saying it has script that you can probably copy, tweak, & use.
Enjoy!
|
|
|
|
|
hi.
i'm sorry if i made a confussion for u..
let i give u a clear define of my project
i just want to make a prototype for drag and drop online test. i'm going to prepare a test bank for the test. the online test is for the student. it will be a drag and drop test. the test need the student to drag a picture to a right box given.. for example, there are 4 pic on the top of the screen. and on the bottom of it, there are 4 box which are boxes with the name of the picture. student need to drag the pic to the right box according to the name. the student will fill the all 4 boxes with dragging the 4 pic given and then they move to the next drag and drop question.at the end of the test, the mark will be given to the students when the student click the submit button. the mark will be calculated for the right pic drag on the right box.
so, i have a difficulty to code the mark for it..that's my problem..did u get it? i'm very happy if u can help me as soon as possible.
bye
|
|
|
I think I understand clearly what you want, and I think the links I provided should give you enough code to figure out the hard parts.
Use the first link I gave you. That code knows which id you are dragging, and it knows the position of where you are dropping it. So if you know the position of your correct box, and you give each of your pictures an ID....you can know when an ID (picture) is dragged to the correct box.
The hardest part is how to accomplish the drag & drop -- not knowing which item is dropped where. So that first link gives you code to look at and figure out how to do what you want.
I don't currently have time to code your solution for you. I'd rather teach you to fish than give you a fish anyway. Let us know how it goes.
|
|
|
|
|
actually i hve a very limited time to complete this project..and i'm affraid that i can't finish it because i have many more project to do...but i will try first..but this project do really impact my pointer in my result...
thakns a lot..
-me-
|
|
|
hi guys..
i'm success in dragging the pic but i have a difficulty in marking the quizzes. how can i set the mark. when the student drag a pic to a correct box, the mark will be calculated for it...can u plez help me to code it...
-me-
|
|
|