Update of /cvsroot/stack/stack-dev/opaque
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv8281/opaque
Modified Files:
MoodleQuestionDeployment.php
Log Message:
Towards 'hot' updates of questions in Moodle.
Index: MoodleQuestionDeployment.php
===================================================================
RCS file: /cvsroot/stack/stack-dev/opaque/MoodleQuestionDeployment.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** MoodleQuestionDeployment.php 2 Nov 2010 18:07:49 -0000 1.7
--- MoodleQuestionDeployment.php 12 Nov 2010 10:11:06 -0000 1.8
***************
*** 156,160 ****
--- 156,163 ----
$mDB = new MoodleDB();
$mDB->connect();
+ // Grab info here before later queries hijack connection
+ $attempts = $mDB->attemptsOnQuestion($earliest);
$categories = $mDB->getQuestionCategory($earliest);
+
//$this->xhtml .= print_r($categories, 1);
$selector = $mDB->categorySelector('category', $categories[0]);
***************
*** 181,191 ****
$this->xhtml .= '<input type="text" name="add" id="add" value="'.$this->deployment->size().'" size="3" maxlength="3"/> '.get_string('FE_deployQuestion_newRandomInstances', 'stack');
$this->xhtml .= ' into '.$selector;//'category',$mDB->getQuestionCategory($earliest));
! /*if($mDB->attemptsOnQuestion()) {
$this->xhtml .= "<br>Already in use in a quiz!";
//$this->xhtml .= '<br />Also replace in Moodle quizzes <input onclick="if(this.checked == true) alert(\'Only do this for minor changes to ensure stored student attempts are still valid!\')" type="checkbox">'; // list them and warn!
} else $this->xhtml .= "<br>Fortunately not in use in a quiz!";
!
! $this->xhtml .= "<br>Attempts on question: ".$mDB->attemptsOnQuestion($earliest);
! */
$this->xhtml .= '<br /><input type="submit" onclick="if($(\'#add\').val() == \'0\') {alert(\'zero\'); return false;}" name="submit" value="'.get_string('stackDeploy_button_update', 'stack').'">';
$this->xhtml .= '<input type="hidden" name="prior" value="'.$earliest.'"></form>';
--- 184,192 ----
$this->xhtml .= '<input type="text" name="add" id="add" value="'.$this->deployment->size().'" size="3" maxlength="3"/> '.get_string('FE_deployQuestion_newRandomInstances', 'stack');
$this->xhtml .= ' into '.$selector;//'category',$mDB->getQuestionCategory($earliest));
! /*if($attempts) {
$this->xhtml .= "<br>Already in use in a quiz!";
//$this->xhtml .= '<br />Also replace in Moodle quizzes <input onclick="if(this.checked == true) alert(\'Only do this for minor changes to ensure stored student attempts are still valid!\')" type="checkbox">'; // list them and warn!
} else $this->xhtml .= "<br>Fortunately not in use in a quiz!";
! */
$this->xhtml .= '<br /><input type="submit" onclick="if($(\'#add\').val() == \'0\') {alert(\'zero\'); return false;}" name="submit" value="'.get_string('stackDeploy_button_update', 'stack').'">';
$this->xhtml .= '<input type="hidden" name="prior" value="'.$earliest.'"></form>';
|