Plugin Directory

Changeset 948896


Ignore:
Timestamp:
07/15/2014 03:29:57 PM (12 years ago)
Author:
Fubra
Message:

Tagging version 2.14.1

Location:
wp-survey-and-quiz-tool
Files:
29 edited
3 copied

Legend:

Unmodified
Added
Removed
  • wp-survey-and-quiz-tool/tags/2.14.1/js/generic.js

    r553819 r948896  
    160160        var html = '';
    161161        html += '<tr>';
    162         html += '<td><input type="text" name="multiple_name['+rowCount+']" value="" /></td>';
     162        html += '<td><input type="text" name="multiple_name['+rowCount+']" value="" style="width: 98%;" /></td>'; // mod: width added
    163163        html += '<td><input type="checkbox" name="multiple_correct['+rowCount+']"  value="yes" /></td>';
    164164        html += '<td><input type="checkbox" name="multiple_delete['+rowCount+']" value="yes" /></td>';
  • wp-survey-and-quiz-tool/tags/2.14.1/lib/Wpsqt/Core.php

    r931176 r948896  
    168168            $blog_id.'/'.$_SESSION['wpsqt']['current_type'].'-'.$_SESSION['wpsqt']['item_id'].'/' : '';
    169169
    170         if ( file_exists(WPSQT_DIR.'pages/custom/'.$quizPath.$file) ){
     170        $themeFile = get_template_directory() . '/wpsqt/' . $file;
     171       
     172        if ( file_exists($themeFile) ) {
     173            return $themeFile;
     174        } elseif ( file_exists(WPSQT_DIR.'pages/custom/'.$quizPath.$file) ){
    171175            return WPSQT_DIR.'pages/custom/'.$quizPath.$file;
    172176        } elseif (file_exists(WPSQT_DIR.'pages/custom/'.$blog_id.'/shared/'.$file)) {
  • wp-survey-and-quiz-tool/tags/2.14.1/lib/Wpsqt/Export/Csv.php

    r931176 r948896  
    2929    public function generate($id) {
    3030        global $wpdb;
     31       
     32        $type = $wpdb->get_row($wpdb->prepare("SELECT `type` FROM `".WPSQT_TABLE_QUIZ_SURVEYS."` WHERE id = %d", array($id)),ARRAY_A);
    3133
    32         $results = $wpdb->get_results('SELECT * FROM '.WPSQT_TABLE_RESULTS.' WHERE item_id = "'.$id.'"', ARRAY_A);
     34        switch ($type['type']){
     35            case 'quiz':
     36                $results = $wpdb->get_results('SELECT * FROM '.WPSQT_TABLE_RESULTS.' WHERE item_id = "'.$id.'"', ARRAY_A);
     37                $this->csvLines[] = 'id, Name, Score, Total, Percentage, Pass/Fail, Status, Date';
     38                foreach( $results as $result ){
     39                    $csvline = $result['id'].",";
     40                    $csvline .= $result['person_name'].',';
     41                    if($result['total'] == 0) {$csvline .= ',,';} else {$csvline .= $result['score'].",".$result['total'].",";}
     42                    if($result['total'] == 0) {$csvline .= ',';} else {$csvline .= $result['percentage']."%,";}
     43                    if ($result['pass'] == 1) {$csvline .= "Pass,";} else {$csvline .= "Fail,";}
     44                    $csvline .= ucfirst($result['status']).",";
     45                    if (!empty($result['datetaken'])) { $csvline .= date('d-m-y G:i:s',$result['datetaken']); };
     46                    $this->csvLines[] = $csvline;
     47                }   
     48                break;
     49            case 'survey':
     50            case 'poll':
     51                $results = $wpdb->get_row($wpdb->prepare("SELECT * FROM `".WPSQT_TABLE_SURVEY_CACHE."` WHERE item_id = %d",array($id)), ARRAY_A);
     52                $sections = unserialize($results['sections']);
     53                $this->csvLines[] = 'Question Name,Answer,Votes,Percentages';
    3354
    34         $this->csvLines[] = 'id, Name, Score, Total, Percentage, Pass/Fail, Status, Date';
    35         foreach( $results as $result ){
    36             $csvline = $result['id'].",";
    37             $csvline .= $result['person_name'].',';
    38             if($result['total'] == 0) {$csvline .= ',,';} else {$csvline .= $result['score'].",".$result['total'].",";}
    39             if($result['total'] == 0) {$csvline .= ',';} else {$csvline .= $result['percentage']."%,";}
    40             if ($result['pass'] == 1) {$csvline .= "Pass,";} else {$csvline .= "Fail,";}
    41             $csvline .= ucfirst($result['status']).",";
    42             if (!empty($result['datetaken'])) { $csvline .= date('d-m-y G:i:s',$result['datetaken']); };
    43             $this->csvLines[] = $csvline;
     55                if (empty($sections) || !is_array($sections)) {
     56                    break;
     57                }
     58       
     59                foreach ($sections as $section) {
     60                    foreach ($section['questions'] as $question) {
     61                        $answers_display = array();
     62                        if (!empty($question['answers']) && is_array($question['answers'])) {
     63                            switch ($question['type']){
     64                                case 'Likert Matrix':
     65                                    $total = array();
     66                                    foreach($question['answers'] as $answer_name => $values) {
     67                                        //TODO: Look up this other
     68                                        if ($answer_name == 'other') continue;
     69                                        $answers_display[$answer_name] = array();
     70                                        $total[$answer_name] =0;
     71                                        foreach ($values as $value){
     72                                            $answers_display[$answer_name][] = $value['count'];
     73                                            $total[$answer_name] += $value['count'];
     74                                        }
     75                                    }
     76                                    break;
     77                                case 'Likert':
     78                                    $total = 0;
     79                                    foreach($question['answers'] as $answer_name => $values) {
     80                                        $answers_display[$answer_name] = $values['count'];
     81                                        $total += $values['count'];
     82                                    }
     83                                    break;
     84                                default:
     85                                    $total = 0;
     86                                    foreach($question['answers'] as $answer) {
     87                                        $answers_display[$answer['text']] = $answer['count'];
     88                                        $total += $answer['count'];
     89                                    }
     90                                    break;
     91                            }
     92                        }
     93                        if ($question['type'] == 'Free Text') {
     94                            $csvLine .= $question['name'].',This question has free text answers which cannot be shown,,,';
     95                            $this->csvLines[] = $csvLine;
     96                            continue;
     97                        }else{
     98                            foreach ($answers_display as $name => $count) {
     99                                $csvLine = $question['name'];
     100                                $question['name'] = str_repeat(' ',strlen($question['name'])); //After the first use, we left it blank to avoid repetitions
     101                                $csvLine .= ','.$name.'';
     102                                if ($question['type'] == 'Likert Matrix'){
     103                                    $porcentage = array();
     104                                   
     105                                    $csvLine .= ',';
     106                                    foreach ($count as $c){
     107                                        $csvLine .= $c.'|';
     108                                        $porcentage[] = $total[$name] ? round($c / $total[$name] * 100, 2) : 0;
     109                                    }
     110
     111                                    $csvLine .= ','.implode('%|', $porcentage).'%"';
     112                                }else{
     113                                    $percentage = round($count / $total * 100, 2);
     114                                    $csvLine .= ','.$count;
     115                                    $csvLine .= ','.$percentage.'%';
     116                                }
     117                                $this->csvLines[] = $csvLine;
     118                            }
     119                        }
     120                    }
     121                }
     122                break;
     123            default:
     124                break;
    44125        }
     126       
    45127
    46128        return $this->csvLines;
  • wp-survey-and-quiz-tool/tags/2.14.1/lib/Wpsqt/Page/Main/Results/Mark.php

    r931176 r948896  
    8787            $wpdb->query(
    8888                $wpdb->prepare('UPDATE '.WPSQT_TABLE_RESULTS.' SET sections=%s,status=%s,score=%d,total=%d,percentage=%d,pass=%d WHERE id = %d',
    89                             array( serialize($ser),$_POST['status'],$currentPoints,$totalPoints,$percentage,$pass_fail,$_GET['resultid']) )
     89                            array( $ser,$_POST['status'],$currentPoints,$totalPoints,$percentage,$pass_fail,$_GET['resultid']) )
    9090                        );
    9191            $this->redirect(WPSQT_URL_MAIN."&section=results"."&subsection=quiz&id=".$_GET['id']."&marked=true");           
  • wp-survey-and-quiz-tool/tags/2.14.1/lib/Wpsqt/Question.php

    r931176 r948896  
    9191            return "Someone has dun goof'd! No question form view!";
    9292        }
    93         if ( !isset(self::$_called[$this::$_id]) ){
     93        if ( !isset(self::$_called[$this->_id])){
    9494            ob_start();
    9595            extract($this->_questionVars);
    9696            require $this->_formView;
    97             self::$_called[$this::$_id] = true;
     97            self::$_called[$this->_id] = true;
    9898            return ob_get_clean();
    9999        }
  • wp-survey-and-quiz-tool/tags/2.14.1/lib/Wpsqt/Question/Freetext.php

    r931176 r948896  
    1616       
    1717        $this->_questionVars = $value;
    18         $this::$_id = "freetext";
     18        $this->_id = "freetext";
    1919        $this->_formView = WPSQT_DIR."pages/admin/forms/question.freetext.php";
    2020        $this->_displayView = WPSQT_DIR."pages/site/questions/textarea.php";
  • wp-survey-and-quiz-tool/tags/2.14.1/lib/Wpsqt/Question/Likert.php

    r931176 r948896  
    1414    public function __construct(array $values = array()){
    1515                                       
    16         $this::$_id = "likert";                                     
     16        $this->_id = "likert";                                     
    1717        $this->_formView = WPSQT_DIR."pages/admin/forms/question.likert.php";
    1818        $this->_displayView = WPSQT_DIR."pages/site/questions/likert.php";
  • wp-survey-and-quiz-tool/tags/2.14.1/lib/Wpsqt/Question/Likertmatrix.php

    r931176 r948896  
    1414    public function __construct(array $values = array()){
    1515                                       
    16         $this::$_id = "likertmatrix";                                       
     16        $this->_id = "likertmatrix";                                       
    1717        $this->_questionVars['answers'] = array('text' => false);
    1818        $this->_formView = WPSQT_DIR."pages/admin/forms/question.likertmatrix.php";
  • wp-survey-and-quiz-tool/tags/2.14.1/lib/Wpsqt/Question/Multiple.php

    r931176 r948896  
    1717       
    1818        $this->_questionVars['answers'] = array( array( "text" => false, "correct" => false) );                                 
    19         $this::$_id = "multiple";                                       
     19        $this->_id = "multiple";                                       
    2020        $this->_formView = WPSQT_DIR."pages/admin/forms/question.multiple.php";
    2121        $this->_displayView = WPSQT_DIR."pages/site/questions/multiple.php";
  • wp-survey-and-quiz-tool/tags/2.14.1/lib/Wpsqt/Shortcode.php

    r931176 r948896  
    304304                    $timerVal = $timerVal - $_POST['wpsqt_time_elapsed'];
    305305                }
    306                 echo '<div class="timer" style="float: right;"></div>';
     306                echo '<div class="timer" style="float: right;">&nbsp;</div>';
    307307                $timerStrings = array(
    308308                    'timeleft' => __('Time Left:', 'wp-survey-and-quiz-tool'),
     
    395395                        if ( $subCorrect === $subNumOfCorrect && $subIncorrect === 0 ){
    396396                            $correct += $questionData["points"];
    397                             $answerMarked['mark'] = __('correct', 'wp-survey-and-quiz-tool');
     397                            __('correct', 'wp-survey-and-quiz-tool');
     398                            $answerMarked['mark'] = 'correct';
    398399                        }
    399400                        else {
     
    401402
    402403                            $incorrect += $questionData["points"];
    403                             $answerMarked['mark'] = __('incorrect', 'wp-survey-and-quiz-tool');
     404                            __('incorrect', 'wp-survey-and-quiz-tool');
     405                            $answerMarked['mark'] = 'incorrect';
    404406                        }
    405407                    } else {
     
    611613
    612614        if ( $canAutoMark === true ){
    613             $_SESSION['wpsqt']['current_score'] = $correctAnswers." correct out of ".$totalPoints;
     615            $_SESSION['wpsqt']['current_score'] = sprintf( __("%d correct out of %d", 'wp-survey-and-quiz-tool'), $correctAnswers, $totalPoints );
     616           
     617            $_SESSION['wpsqt']['correct_answers'] = $correctAnswers;
     618            $_SESSION['wpsqt']['total_points'] = $totalPoints;
    614619        } else {
    615620            $_SESSION['wpsqt']['current_score'] = __('Quiz can\'t be auto marked', 'wp-survey-and-quiz-tool');
     
    838843                            } else {
    839844                                $givenAnswerData = explode("_", $givenAnswerData);
    840                                 $cachedSections[$sectionKey]['questions'][$question['id']]['answers'][$givenAnswerData[0]][$givenAnswerData[1]]['count'] += 1;
     845                                if(isset($cachedSections[$sectionKey]['questions'][$question['id']]['answers'][$givenAnswerData[0]][$givenAnswerData[1]]['count'])){
     846                                    $cachedSections[$sectionKey]['questions'][$question['id']]['answers'][$givenAnswerData[0]][$givenAnswerData[1]]['count'] += 1;
     847                                } else {
     848                                    $cachedSections[$sectionKey]['questions'][$question['id']]['answers'][$givenAnswerData[0]][$givenAnswerData[1]]['count'] = 1;
     849                                }
    841850                            }
    842851                        }
  • wp-survey-and-quiz-tool/tags/2.14.1/lib/Wpsqt/Tokens.php

    r931176 r948896  
    122122        if ($_SESSION['wpsqt']['current_type'] == 'quiz' && isset($_SESSION['wpsqt']['current_score'])) {
    123123            // Calculate percentage
    124             preg_match('$(\d*)\scorrect\sout\sof\s(\d*)$', $_SESSION['wpsqt']['current_score'], $score);
    125             if (isset($score) && is_array($score) && isset($score[2]) && $score[2] != 0) {
    126                 $percentage = $score[1] / $score[2] * 100;
     124            if ( isset($_SESSION['wpsqt']['correct_answers']) && isset($_SESSION['wpsqt']['total_points']) ) {
     125                $percentage = $_SESSION['wpsqt']['correct_answers'] / $_SESSION['wpsqt']['total_points'] * 100;
    127126                $percentage = number_format($percentage, 1) . '%';
    128127            } else {
  • wp-survey-and-quiz-tool/tags/2.14.1/pages/admin/forms/question.multiple.php

    r424718 r948896  
    1515                    foreach( $answers as $key => $answer ) { ?>
    1616                <tr>
    17                     <td><input type="text" name="multiple_name[<?php echo $i; ?>]" value="<?php echo esc_attr(wp_kses_stripslashes($answer["text"])); ?>" /></td>
     17                    <td><input type="text" name="multiple_name[<?php echo $i; ?>]" value="<?php echo esc_attr(wp_kses_stripslashes($answer["text"])); ?>" style="width: 98%;" /></td>
    1818                    <td><input type="checkbox" name="multiple_correct[<?php echo  $i; ?>]" <?php if ( $answer["correct"] == "yes" ){ ?> checked="checked"<?php }?> value="yes" /></td>
    1919                    <td><input type="radio" name="multiple_default" <?php if ( isset($answer["default"]) && $answer["default"] == "yes" ){ ?> checked="checked"<?php }?> value="<?php echo $i; ?>" /></td>
  • wp-survey-and-quiz-tool/tags/2.14.1/pages/admin/poll/result.php

    r575966 r948896  
    1010        <input type="submit" name="deleteall" value="Delete All Results" />
    1111    </form>
    12    
     12    <div class="tablenav">
     13        <div class="tablenav-pages">
     14            <a href="<?php echo WPSQT_URL_MAIN; ?>&section=results&subsection=quiz&id=<?php echo urlencode($_GET['id']); ?>&wpsqt-download=<?php echo urlencode($_GET['id']); ?>">Export CSV</a>
     15        </div>
     16    </div>
    1317    <?php if ( isset($message) ) { ?>
    1418    <div class="updated">
  • wp-survey-and-quiz-tool/tags/2.14.1/pages/admin/surveys/result.list.php

    r455948 r948896  
    1717
    1818            <div class="tablenav-pages">
     19                <a href="<?php echo WPSQT_URL_MAIN; ?>&section=results&subsection=survey&id=<?php echo urlencode($_GET['id']); ?>&wpsqt-download=<?php echo urlencode($_GET['id']); ?>">Export CSV</a>
    1920                <?php echo Wpsqt_Core::getPaginationLinks($currentPage, $numberOfPages); ?>
    2021            </div>
  • wp-survey-and-quiz-tool/tags/2.14.1/readme.txt

    r931670 r948896  
    66Tested up to: 3.9.1
    77Text Domain: wp-survey-and-quiz-tool
    8 Stable tag: 2.14
     8Stable tag: 2.14.1
    99A highly customisable Quiz, Survey and Poll plugin to which allows for unlimited questions and sections.
    1010
     
    6464
    6565== ChangeLog ==
     66
     67= 2.14.1 =
     68* Fixed compatiblity issues with PHP 5.2
     69* Fixing double serialization bug for quiz results
     70* Added export poll to csv feature
     71* Other minors bugs fixed
    6672
    6773= 2.14 =
  • wp-survey-and-quiz-tool/trunk/js/generic.js

    r553819 r948896  
    160160        var html = '';
    161161        html += '<tr>';
    162         html += '<td><input type="text" name="multiple_name['+rowCount+']" value="" /></td>';
     162        html += '<td><input type="text" name="multiple_name['+rowCount+']" value="" style="width: 98%;" /></td>'; // mod: width added
    163163        html += '<td><input type="checkbox" name="multiple_correct['+rowCount+']"  value="yes" /></td>';
    164164        html += '<td><input type="checkbox" name="multiple_delete['+rowCount+']" value="yes" /></td>';
  • wp-survey-and-quiz-tool/trunk/lib/Wpsqt/Core.php

    r931176 r948896  
    168168            $blog_id.'/'.$_SESSION['wpsqt']['current_type'].'-'.$_SESSION['wpsqt']['item_id'].'/' : '';
    169169
    170         if ( file_exists(WPSQT_DIR.'pages/custom/'.$quizPath.$file) ){
     170        $themeFile = get_template_directory() . '/wpsqt/' . $file;
     171       
     172        if ( file_exists($themeFile) ) {
     173            return $themeFile;
     174        } elseif ( file_exists(WPSQT_DIR.'pages/custom/'.$quizPath.$file) ){
    171175            return WPSQT_DIR.'pages/custom/'.$quizPath.$file;
    172176        } elseif (file_exists(WPSQT_DIR.'pages/custom/'.$blog_id.'/shared/'.$file)) {
  • wp-survey-and-quiz-tool/trunk/lib/Wpsqt/Export/Csv.php

    r931176 r948896  
    2929    public function generate($id) {
    3030        global $wpdb;
     31       
     32        $type = $wpdb->get_row($wpdb->prepare("SELECT `type` FROM `".WPSQT_TABLE_QUIZ_SURVEYS."` WHERE id = %d", array($id)),ARRAY_A);
    3133
    32         $results = $wpdb->get_results('SELECT * FROM '.WPSQT_TABLE_RESULTS.' WHERE item_id = "'.$id.'"', ARRAY_A);
     34        switch ($type['type']){
     35            case 'quiz':
     36                $results = $wpdb->get_results('SELECT * FROM '.WPSQT_TABLE_RESULTS.' WHERE item_id = "'.$id.'"', ARRAY_A);
     37                $this->csvLines[] = 'id, Name, Score, Total, Percentage, Pass/Fail, Status, Date';
     38                foreach( $results as $result ){
     39                    $csvline = $result['id'].",";
     40                    $csvline .= $result['person_name'].',';
     41                    if($result['total'] == 0) {$csvline .= ',,';} else {$csvline .= $result['score'].",".$result['total'].",";}
     42                    if($result['total'] == 0) {$csvline .= ',';} else {$csvline .= $result['percentage']."%,";}
     43                    if ($result['pass'] == 1) {$csvline .= "Pass,";} else {$csvline .= "Fail,";}
     44                    $csvline .= ucfirst($result['status']).",";
     45                    if (!empty($result['datetaken'])) { $csvline .= date('d-m-y G:i:s',$result['datetaken']); };
     46                    $this->csvLines[] = $csvline;
     47                }   
     48                break;
     49            case 'survey':
     50            case 'poll':
     51                $results = $wpdb->get_row($wpdb->prepare("SELECT * FROM `".WPSQT_TABLE_SURVEY_CACHE."` WHERE item_id = %d",array($id)), ARRAY_A);
     52                $sections = unserialize($results['sections']);
     53                $this->csvLines[] = 'Question Name,Answer,Votes,Percentages';
    3354
    34         $this->csvLines[] = 'id, Name, Score, Total, Percentage, Pass/Fail, Status, Date';
    35         foreach( $results as $result ){
    36             $csvline = $result['id'].",";
    37             $csvline .= $result['person_name'].',';
    38             if($result['total'] == 0) {$csvline .= ',,';} else {$csvline .= $result['score'].",".$result['total'].",";}
    39             if($result['total'] == 0) {$csvline .= ',';} else {$csvline .= $result['percentage']."%,";}
    40             if ($result['pass'] == 1) {$csvline .= "Pass,";} else {$csvline .= "Fail,";}
    41             $csvline .= ucfirst($result['status']).",";
    42             if (!empty($result['datetaken'])) { $csvline .= date('d-m-y G:i:s',$result['datetaken']); };
    43             $this->csvLines[] = $csvline;
     55                if (empty($sections) || !is_array($sections)) {
     56                    break;
     57                }
     58       
     59                foreach ($sections as $section) {
     60                    foreach ($section['questions'] as $question) {
     61                        $answers_display = array();
     62                        if (!empty($question['answers']) && is_array($question['answers'])) {
     63                            switch ($question['type']){
     64                                case 'Likert Matrix':
     65                                    $total = array();
     66                                    foreach($question['answers'] as $answer_name => $values) {
     67                                        //TODO: Look up this other
     68                                        if ($answer_name == 'other') continue;
     69                                        $answers_display[$answer_name] = array();
     70                                        $total[$answer_name] =0;
     71                                        foreach ($values as $value){
     72                                            $answers_display[$answer_name][] = $value['count'];
     73                                            $total[$answer_name] += $value['count'];
     74                                        }
     75                                    }
     76                                    break;
     77                                case 'Likert':
     78                                    $total = 0;
     79                                    foreach($question['answers'] as $answer_name => $values) {
     80                                        $answers_display[$answer_name] = $values['count'];
     81                                        $total += $values['count'];
     82                                    }
     83                                    break;
     84                                default:
     85                                    $total = 0;
     86                                    foreach($question['answers'] as $answer) {
     87                                        $answers_display[$answer['text']] = $answer['count'];
     88                                        $total += $answer['count'];
     89                                    }
     90                                    break;
     91                            }
     92                        }
     93                        if ($question['type'] == 'Free Text') {
     94                            $csvLine .= $question['name'].',This question has free text answers which cannot be shown,,,';
     95                            $this->csvLines[] = $csvLine;
     96                            continue;
     97                        }else{
     98                            foreach ($answers_display as $name => $count) {
     99                                $csvLine = $question['name'];
     100                                $question['name'] = str_repeat(' ',strlen($question['name'])); //After the first use, we left it blank to avoid repetitions
     101                                $csvLine .= ','.$name.'';
     102                                if ($question['type'] == 'Likert Matrix'){
     103                                    $porcentage = array();
     104                                   
     105                                    $csvLine .= ',';
     106                                    foreach ($count as $c){
     107                                        $csvLine .= $c.'|';
     108                                        $porcentage[] = $total[$name] ? round($c / $total[$name] * 100, 2) : 0;
     109                                    }
     110
     111                                    $csvLine .= ','.implode('%|', $porcentage).'%"';
     112                                }else{
     113                                    $percentage = round($count / $total * 100, 2);
     114                                    $csvLine .= ','.$count;
     115                                    $csvLine .= ','.$percentage.'%';
     116                                }
     117                                $this->csvLines[] = $csvLine;
     118                            }
     119                        }
     120                    }
     121                }
     122                break;
     123            default:
     124                break;
    44125        }
     126       
    45127
    46128        return $this->csvLines;
  • wp-survey-and-quiz-tool/trunk/lib/Wpsqt/Page/Main/Results/Mark.php

    r931176 r948896  
    8787            $wpdb->query(
    8888                $wpdb->prepare('UPDATE '.WPSQT_TABLE_RESULTS.' SET sections=%s,status=%s,score=%d,total=%d,percentage=%d,pass=%d WHERE id = %d',
    89                             array( serialize($ser),$_POST['status'],$currentPoints,$totalPoints,$percentage,$pass_fail,$_GET['resultid']) )
     89                            array( $ser,$_POST['status'],$currentPoints,$totalPoints,$percentage,$pass_fail,$_GET['resultid']) )
    9090                        );
    9191            $this->redirect(WPSQT_URL_MAIN."&section=results"."&subsection=quiz&id=".$_GET['id']."&marked=true");           
  • wp-survey-and-quiz-tool/trunk/lib/Wpsqt/Question.php

    r931176 r948896  
    9191            return "Someone has dun goof'd! No question form view!";
    9292        }
    93         if ( !isset(self::$_called[$this::$_id]) ){
     93        if ( !isset(self::$_called[$this->_id])){
    9494            ob_start();
    9595            extract($this->_questionVars);
    9696            require $this->_formView;
    97             self::$_called[$this::$_id] = true;
     97            self::$_called[$this->_id] = true;
    9898            return ob_get_clean();
    9999        }
  • wp-survey-and-quiz-tool/trunk/lib/Wpsqt/Question/Freetext.php

    r931176 r948896  
    1616       
    1717        $this->_questionVars = $value;
    18         $this::$_id = "freetext";
     18        $this->_id = "freetext";
    1919        $this->_formView = WPSQT_DIR."pages/admin/forms/question.freetext.php";
    2020        $this->_displayView = WPSQT_DIR."pages/site/questions/textarea.php";
  • wp-survey-and-quiz-tool/trunk/lib/Wpsqt/Question/Likert.php

    r931176 r948896  
    1414    public function __construct(array $values = array()){
    1515                                       
    16         $this::$_id = "likert";                                     
     16        $this->_id = "likert";                                     
    1717        $this->_formView = WPSQT_DIR."pages/admin/forms/question.likert.php";
    1818        $this->_displayView = WPSQT_DIR."pages/site/questions/likert.php";
  • wp-survey-and-quiz-tool/trunk/lib/Wpsqt/Question/Likertmatrix.php

    r931176 r948896  
    1414    public function __construct(array $values = array()){
    1515                                       
    16         $this::$_id = "likertmatrix";                                       
     16        $this->_id = "likertmatrix";                                       
    1717        $this->_questionVars['answers'] = array('text' => false);
    1818        $this->_formView = WPSQT_DIR."pages/admin/forms/question.likertmatrix.php";
  • wp-survey-and-quiz-tool/trunk/lib/Wpsqt/Question/Multiple.php

    r931176 r948896  
    1717       
    1818        $this->_questionVars['answers'] = array( array( "text" => false, "correct" => false) );                                 
    19         $this::$_id = "multiple";                                       
     19        $this->_id = "multiple";                                       
    2020        $this->_formView = WPSQT_DIR."pages/admin/forms/question.multiple.php";
    2121        $this->_displayView = WPSQT_DIR."pages/site/questions/multiple.php";
  • wp-survey-and-quiz-tool/trunk/lib/Wpsqt/Shortcode.php

    r931176 r948896  
    304304                    $timerVal = $timerVal - $_POST['wpsqt_time_elapsed'];
    305305                }
    306                 echo '<div class="timer" style="float: right;"></div>';
     306                echo '<div class="timer" style="float: right;">&nbsp;</div>';
    307307                $timerStrings = array(
    308308                    'timeleft' => __('Time Left:', 'wp-survey-and-quiz-tool'),
     
    395395                        if ( $subCorrect === $subNumOfCorrect && $subIncorrect === 0 ){
    396396                            $correct += $questionData["points"];
    397                             $answerMarked['mark'] = __('correct', 'wp-survey-and-quiz-tool');
     397                            __('correct', 'wp-survey-and-quiz-tool');
     398                            $answerMarked['mark'] = 'correct';
    398399                        }
    399400                        else {
     
    401402
    402403                            $incorrect += $questionData["points"];
    403                             $answerMarked['mark'] = __('incorrect', 'wp-survey-and-quiz-tool');
     404                            __('incorrect', 'wp-survey-and-quiz-tool');
     405                            $answerMarked['mark'] = 'incorrect';
    404406                        }
    405407                    } else {
     
    611613
    612614        if ( $canAutoMark === true ){
    613             $_SESSION['wpsqt']['current_score'] = $correctAnswers." correct out of ".$totalPoints;
     615            $_SESSION['wpsqt']['current_score'] = sprintf( __("%d correct out of %d", 'wp-survey-and-quiz-tool'), $correctAnswers, $totalPoints );
     616           
     617            $_SESSION['wpsqt']['correct_answers'] = $correctAnswers;
     618            $_SESSION['wpsqt']['total_points'] = $totalPoints;
    614619        } else {
    615620            $_SESSION['wpsqt']['current_score'] = __('Quiz can\'t be auto marked', 'wp-survey-and-quiz-tool');
     
    838843                            } else {
    839844                                $givenAnswerData = explode("_", $givenAnswerData);
    840                                 $cachedSections[$sectionKey]['questions'][$question['id']]['answers'][$givenAnswerData[0]][$givenAnswerData[1]]['count'] += 1;
     845                                if(isset($cachedSections[$sectionKey]['questions'][$question['id']]['answers'][$givenAnswerData[0]][$givenAnswerData[1]]['count'])){
     846                                    $cachedSections[$sectionKey]['questions'][$question['id']]['answers'][$givenAnswerData[0]][$givenAnswerData[1]]['count'] += 1;
     847                                } else {
     848                                    $cachedSections[$sectionKey]['questions'][$question['id']]['answers'][$givenAnswerData[0]][$givenAnswerData[1]]['count'] = 1;
     849                                }
    841850                            }
    842851                        }
  • wp-survey-and-quiz-tool/trunk/lib/Wpsqt/Tokens.php

    r931176 r948896  
    122122        if ($_SESSION['wpsqt']['current_type'] == 'quiz' && isset($_SESSION['wpsqt']['current_score'])) {
    123123            // Calculate percentage
    124             preg_match('$(\d*)\scorrect\sout\sof\s(\d*)$', $_SESSION['wpsqt']['current_score'], $score);
    125             if (isset($score) && is_array($score) && isset($score[2]) && $score[2] != 0) {
    126                 $percentage = $score[1] / $score[2] * 100;
     124            if ( isset($_SESSION['wpsqt']['correct_answers']) && isset($_SESSION['wpsqt']['total_points']) ) {
     125                $percentage = $_SESSION['wpsqt']['correct_answers'] / $_SESSION['wpsqt']['total_points'] * 100;
    127126                $percentage = number_format($percentage, 1) . '%';
    128127            } else {
  • wp-survey-and-quiz-tool/trunk/pages/admin/forms/question.multiple.php

    r424718 r948896  
    1515                    foreach( $answers as $key => $answer ) { ?>
    1616                <tr>
    17                     <td><input type="text" name="multiple_name[<?php echo $i; ?>]" value="<?php echo esc_attr(wp_kses_stripslashes($answer["text"])); ?>" /></td>
     17                    <td><input type="text" name="multiple_name[<?php echo $i; ?>]" value="<?php echo esc_attr(wp_kses_stripslashes($answer["text"])); ?>" style="width: 98%;" /></td>
    1818                    <td><input type="checkbox" name="multiple_correct[<?php echo  $i; ?>]" <?php if ( $answer["correct"] == "yes" ){ ?> checked="checked"<?php }?> value="yes" /></td>
    1919                    <td><input type="radio" name="multiple_default" <?php if ( isset($answer["default"]) && $answer["default"] == "yes" ){ ?> checked="checked"<?php }?> value="<?php echo $i; ?>" /></td>
  • wp-survey-and-quiz-tool/trunk/pages/admin/poll/result.php

    r575966 r948896  
    1010        <input type="submit" name="deleteall" value="Delete All Results" />
    1111    </form>
    12    
     12    <div class="tablenav">
     13        <div class="tablenav-pages">
     14            <a href="<?php echo WPSQT_URL_MAIN; ?>&section=results&subsection=quiz&id=<?php echo urlencode($_GET['id']); ?>&wpsqt-download=<?php echo urlencode($_GET['id']); ?>">Export CSV</a>
     15        </div>
     16    </div>
    1317    <?php if ( isset($message) ) { ?>
    1418    <div class="updated">
  • wp-survey-and-quiz-tool/trunk/pages/admin/surveys/result.list.php

    r455948 r948896  
    1717
    1818            <div class="tablenav-pages">
     19                <a href="<?php echo WPSQT_URL_MAIN; ?>&section=results&subsection=survey&id=<?php echo urlencode($_GET['id']); ?>&wpsqt-download=<?php echo urlencode($_GET['id']); ?>">Export CSV</a>
    1920                <?php echo Wpsqt_Core::getPaginationLinks($currentPage, $numberOfPages); ?>
    2021            </div>
  • wp-survey-and-quiz-tool/trunk/readme.txt

    r931670 r948896  
    66Tested up to: 3.9.1
    77Text Domain: wp-survey-and-quiz-tool
    8 Stable tag: 2.14
     8Stable tag: 2.14.1
    99A highly customisable Quiz, Survey and Poll plugin to which allows for unlimited questions and sections.
    1010
     
    6464
    6565== ChangeLog ==
     66
     67= 2.14.1 =
     68* Fixed compatiblity issues with PHP 5.2
     69* Fixing double serialization bug for quiz results
     70* Added export poll to csv feature
     71* Other minors bugs fixed
    6672
    6773= 2.14 =
Note: See TracChangeset for help on using the changeset viewer.