Changeset 85

Show
Ignore:
Timestamp:
05.01.2012 11:22:42 (2 years ago)
Author:
gnum
Message:

estimate will try to set current item now, if none found - will need to wait until anything is set to model.

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/actions/digimina/test/estimate.php

    r59 r85  
    1616 
    1717if (($level instanceof DigiMinaPerformanceLevel) && ($level->getContainerGUID() == $dmtest->getCurrentSubCompetency())) { 
     18    $item = $level->getRandomItem(); 
     19    if (!($item instanceof DigiMinaItem)) { 
     20        /*translation:No questions could be assigned. Please contact administrator.*/ 
     21        register_error(elgg_echo('digimina:error:no:items:found')); 
     22        forward(REFERER); 
     23    } 
    1824    $dmtest->current_level = $level->getGUID(); 
     25    $dmtest->current_item = $item->getGUID(); 
    1926    forward('digimina/test'); 
    2027} else { 
  • trunk/classes/DigiMinaTest.php

    r59 r85  
    7676 
    7777    /** 
     78     * Returns Item if any 
     79     * 
     80     * @return string 
     81     */ 
     82    public function getCurrentItem() { 
     83        return $this->current_item; 
     84    } 
     85 
     86    /** 
    7887     * Returns next subcompetency for the test. 
    7988     * Changes competency if needed. 
  • trunk/views/default/forms/digimina/test/item.php

    r82 r85  
    1414$subcompetency = $level->getContainerEntity(); 
    1515$competency = $subcompetency->getContainerEntity(); 
    16  
    17 // XXX This needs to be saved or something; possibly this should be set elsewhere 
    18 $item = $level->getRandomItem(); 
     16$item = get_entity($dmtest->getCurrentItem()); 
    1917?> 
    2018<h3> 
     
    3028            echo elgg_view_entity($item, array('full_view' => TRUE)); 
    3129        } else { 
    32             /*translation:There are no questions assigned to current level.*/ 
    33             echo elgg_echo('digimina:no:question:assigned'); 
     30            /*translation:No question was assigned. Please contact administrator.*/ 
     31            echo elgg_echo('digimina:no:question:was:assigned'); 
    3432        } 
    3533    ?>