WordPress.org

Ready to get started?Download WordPress

Forums

SS Quiz
Broken (4 posts)

  1. coder0815
    Member
    Posted 1 year ago #

    When quiz starts:

    Warning: array_map() [function.array-map]: Argument #2 should be an array in /homepages/12/d293121340/htdocs/html/wp-content/plugins/ssquiz/client-side.php on line 370

    http://wordpress.org/extend/plugins/ssquiz/

  2. coder0815
    Member
    Posted 1 year ago #

    I figured this out myself:

    The problem is the selector '.quiz' in the js file to get the session.
    In my case i have several other elements with class="quiz ...". So this breaks the plugin.

    Change in client-side.php @ line 48: change

    <div class="quiz" id="<?php echo $session;?>">

    to

    <div class="quiz">
    <input type="hidden" id="quiz-session" name="quiz-session" value="<?php echo $session;?>"/>

    and in quiz.js change every

    var session=$(".quiz").attr("id");

    to

    var session=$('#quiz-session').val();

    You should read several stuff:
    http://www.w3.org/TR/html4/types.html#type-id

    "ID and NAME tokens _must_ begin with a letter ([A-Za-z]) ..."

    And in your js don't use:

    $(this).css...
    $(this).attr...
    $(this).somethingelse....

    Better:

    var $this=$(this);
    $this.css..
    $this.....

    Cheers.
    coder

  3. revven
    Member
    Posted 1 year ago #

    <div class="quiz" id="<?php echo $session;?>">

    to

    <div class="quiz">
    <input type="hidden" id="quiz-session" name="quiz-session" value="<?php echo $session;?>"/>

    and in quiz.js change every

    var session=$(".quiz").attr("id");

    to

    var session=$('#quiz-session').val();

    I implemented this but did not work out ...
    Kindly help

  4. coder0815
    Member
    Posted 1 year ago #

    forget this plugin!

    It seams that this is no longer maintained!

    There was never a response from the developer!

    If you can write PHP and JS and have a look at the source you would say forget this.
    It's broken by design!

    coder

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.