Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Affected Branches:MOODLE_18_STABLE
Description
In Edit Questionnaire mode, the following sequence results in faulty navigation:
—
Go to Re-order question screen
Click Preview... button
Close or do not close the popup Preview window (does not matter).
Come back to the Questionnaire Edit window.
Click either on the Add Section Break, the Edit (one question), the Remove (one question) buttons
-> instead of the desired action, the program takes you to Edit Questions screen !!!
—
Diagnostic.- The preview action changes some of the form parameters and does not reset them correctly
—
Proposed solution.-
In file /questionnaire/manage_survey.php about line 175, add the following test
/// 'q' comes from the question editor as a submit, and can be from the reorder form.
} else if (isset($formdata->q)) {
+ if ($formdata->dst == 1 || is_numeric($formdata>q) || $formdata->src || $formdata->addbreak ) {
+ $formdata->tab = 'order';
+ $formdata->sid = $formdata->instance + 1;
+ }
if ($formdata->tab == 'order' && empty($formdata->q)) {
Please test and commit to CVS if proved reliable.
Thanks
Joseph
Oops! Got it wrong... Upon further testing I found out that I misunderstood the function of the $sid variable (it's the survey id). I propose this new solution (tested in Moodle 1.6 and 1.7):
In file /questionnaire/manage_survey.php about line 175, add the following test lines
/// 'q' comes from the question editor as a submit, and can be from the reorder form.
} else if (isset($formdata->q)) {
+ if ($formdata->sid == 0) { + $formdata->sid = $SESSION->questionnaire_survey_id; + $sid = $formdata->sid; + }
+ if ($formdata->tab != 'questions') { + $formdata->tab = 'order'; + }
if ($formdata->tab == 'order' && empty($formdata->q)) {
Joseph