+ Post New Thread
Results 1 to 3 of 3
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 ...
  1. #1
    ivn
    ivn is offline

    Join Date
    Aug 2010
    Posts
    7
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Cannot submit on click of a button using POST method in moodle

    Hello

    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[0] and Next Question displayed: array[1]
    So the value at array[0] 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[1] 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[1] and Next question would print: array[2].

    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.

    Thanks
    Ivn

  2. #2

    Join Date
    Dec 2007
    Location
    Preston
    Posts
    362
    Thank Post
    14
    Thanked 84 Times in 77 Posts
    Rep Power
    30
    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?)

  3. #3
    ivn
    ivn is offline

    Join Date
    Aug 2010
    Posts
    7
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 22
    Last Post: 2nd March 2011, 02:49 PM
  2. Logoff Method?
    By dave.81 in forum Windows 7
    Replies: 8
    Last Post: 5th March 2010, 01:23 PM
  3. Replies: 3
    Last Post: 20th January 2010, 09:56 PM
  4. Ghost - best method ?
    By difinity in forum O/S Deployment
    Replies: 7
    Last Post: 23rd November 2009, 07:29 PM
  5. Submit CTF to NAA using SIMS
    By penfold_99 in forum MIS Systems
    Replies: 9
    Last Post: 15th July 2008, 06:29 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •