Virtual Learning Platforms Thread, Cannot submit on click of a button using POST method in moodle in Technical; Hello
I am working in moodle, and basically trying to add a few features to Quiz Activity as a part ...
14th August 2010, 03:12 PM #1
- Rep Power
Cannot submit on click of a button using POST method in moodle
I am working in moodle, and basically trying to add a few features to Quiz Activity as a part of my project.
Since I am novice to moodle and PHP I need some help in PHP coding.
I have built a web page using "Add a resource" in moodle and I am writing the code in its view.php file.
I am trying to load all question ids for a particular quiz in an array and when the page loads for the first time (view.php) I am trying to print the first two values of array as follows: Current Question displayed: array and Next Question displayed: array
So the value at array position should get stored in another temporary table called quiz_currentquestion which has a field (currentquestion).
Now on click of Add button, the existing value should get deleted from quiz_currentquestion table and the new value that is the array should be inserted into the table. (i.e. every time there would be just one record in quiz_currentquestion table)
Thus on click of ADD button, the string being displayed on screen should get incremented. i.e. Current Question wil nw be :array and Next question would print: array.
But on click of button, it again executes the entire code and thus the prev value doesn't get stored in the database at all.
Is it something to do with submit button, or the logic written in PHP is wrong. Please let me know as I have been trying this thing since last 3 days and am clueless so as to what is the possible reason behind this.
IDG Tech News
14th August 2010, 03:31 PM #2
Ivn - I suggest you ask on the dedicated Moodle quiz forum here http://moodle.org/mod/forum/view.php?id=737 and in fact Tim Hunt is your man - he does the Moodle quiz and is around pretty much all the time. (Are you working on 1.9 or 2.o?)
14th August 2010, 06:59 PM #3
- Rep Power
I did try posting my question on moodle forum in Quiz section but haven't received any reply yet.
But I did get a solution.
Anyway Thanks for replying.
By painejake in forum Coding
Last Post: 2nd March 2011, 03:49 PM
By dave.81 in forum Windows 7
Last Post: 5th March 2010, 02:23 PM
By IT_Freek in forum How do you do....it?
Last Post: 20th January 2010, 10:56 PM
By difinity in forum O/S Deployment
Last Post: 23rd November 2009, 08:29 PM
By penfold_99 in forum MIS Systems
Last Post: 15th July 2008, 07:29 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)