From: Simon H. <sim...@us...> - 2010-11-02 18:07:57
|
Update of /cvsroot/stack/stack-dev/opaque In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv10214/opaque Modified Files: MoodleQuestionDeployment.php Log Message: Polishing the deployment page, including moodle category selector. Index: MoodleQuestionDeployment.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/MoodleQuestionDeployment.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MoodleQuestionDeployment.php 1 Nov 2010 18:18:30 -0000 1.6 --- MoodleQuestionDeployment.php 2 Nov 2010 18:07:49 -0000 1.7 *************** *** 127,131 **** // Handle Moodle question bank operations here if($param['operation'] == 'update') { ! $this->logger->debug("about to call hideQuestion with $stackID and engine:".$this->deployment->getEngineID()); // add new and remove old $mDB = new MoodleDB(); --- 127,131 ---- // Handle Moodle question bank operations here if($param['operation'] == 'update') { ! $this->logger->debug("about to call hideQuestion with $stackID and engine:".$this->deployment->getEngineID()); // add new and remove old $mDB = new MoodleDB(); *************** *** 135,138 **** --- 135,145 ---- $mDB->addQuestion($param['id'], $this->deployment->getLine(), $param['userID'], $this->deployment->getEngineID(), $param['category']); } + + if($param['operation'] == 'move') { + $mDB = new MoodleDB(); + $mDB->connect(); + + $mDB->addQuestion($param['id'], $this->deployment->getLine(), $param['userID'], $this->deployment->getEngineID(), $param['category']); + } } *************** *** 153,157 **** $selector = $mDB->categorySelector('category', $categories[0]); - if($currentVersion == $this->deployment->getVersion()) { // this is latest version //$earliest = $this->deployment->earliestDeployedVersion(); --- 160,163 ---- *************** *** 159,163 **** if($this->deployment->isSingleton()) $this->xhtml .= get_string('FE_deployQuestion_singletonDeployed', 'stack'); else $this->xhtml .= $this->deployment->formXHTML(); ! //$this->xhtml .= $selector; } else { // earlier version has been deployed - must drop it before we can deploy latest //$this->xhtml .= '<div class="warning">'.get_string('FE_deployQuestion_oldVersionDeployed', 'stack')."</div>"; --- 165,171 ---- if($this->deployment->isSingleton()) $this->xhtml .= get_string('FE_deployQuestion_singletonDeployed', 'stack'); else $this->xhtml .= $this->deployment->formXHTML(); ! if($this->deployment->size() > 0) { // don't want to deploy empty versions! ! $this->xhtml .= '<p /><input type="submit" name="submit" value="'.get_string('FE_deployQuestion_moveTo', 'stack').'" '.$selector; ! } } else { // earlier version has been deployed - must drop it before we can deploy latest //$this->xhtml .= '<div class="warning">'.get_string('FE_deployQuestion_oldVersionDeployed', 'stack')."</div>"; |