Ignore:
Timestamp:
09/19/11 18:04:48 (14 years ago)
Author:
fpvanagthoven
Message:

questions get loaded in fully

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/QuestionCreationTool.php

    r112 r114  
    77 */
    88class QuestionCreationTool {
    9 
    10     private $list;
     9    private $questions;
    1110    private $questionEditPanel;
    1211
    13     public function __construct() {
     12    public function __construct($questions) {
     13        $this->questions = $questions;
    1414        $this->javascript();
    1515        $this->displayList();
     
    295295                var typeSelect = document.getElementById("questionTypeSelect");
    296296                typeSelect.selectedIndex = 0;
     297                clearSpecifications();
    297298            }
    298299           
     
    305306        <div id="questionListWrapper">
    306307            <select id="questionsList" size="9999">
     308                <?php $this->populateList(); ?>
    307309            </select>
    308310        </div>
     
    326328                    <td id="categoryBox"><!-- Select should be filled with existing categories-->
    327329                        <select id="questionCategorySelect" name="questionCategory">
    328                             <option value='Test Category'>Test Category</option>
     330                            <option value='Uncategorized' selected='selected'>Uncategorized</option>
    329331                        </select>
    330332                        <!-- New category button -->
     
    363365        <?php
    364366    }
     367   
     368    private function populateList()
     369    {
     370        foreach ($this->questions as $question)
     371        {
     372            ?>
     373        <option value="<?php echo $question->code; ?>">
     374        <?php echo $question->code . " - " . $question->title; ?>
     375        </option>
     376        <?php
     377        }
     378    }
    365379
    366380}
Note: See TracChangeset for help on using the changeset viewer.