Skip to content

Commit

Permalink
Fixed issue #09906: Invalid survey is set finished in response table …
Browse files Browse the repository at this point in the history
…with index complete

Dev: the first move set 'completed' to reponse table, then even if coma back : response tabke is set 'completed' and token 'uncompleted'
Dev: SurveyRuntimeHelper become more an more complicated ....
Dev: a good reason to add event to move 'index' to plugin ..... no ?
  • Loading branch information
Shnoulle committed Sep 25, 2015
1 parent b844576 commit d9d3062
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -360,6 +360,8 @@ function run($surveyid,$args) {
{
// may be submitting from the navigation bar, in which case need to process all intervening questions
// in order to update equations and ensure there are no intervening relevant mandatory or relevant invalid questions
if($thissurvey['questionindex']==2) // Must : save actual page , review whole before set finished to true (see #09906), index==1 seems to don't need it : (don't force move)
LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions);
$moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['totalsteps'] + 1, false);
}
}
Expand Down Expand Up @@ -391,7 +393,7 @@ function run($surveyid,$args) {
if (isset($moveResult) && isset($moveResult['seq']) )// Reload at first page (welcome after click previous fill an empty $moveResult array
{
// With complete index, we need to revalidate whole group bug #08806. It's actually the only mode where we JumpTo with force
if($moveResult['finished'] == true && $thissurvey['questionindex']==2)// $thissurvey['questionindex']>=2
if($moveResult['finished'] == true && $move != 'movesubmit' && $thissurvey['questionindex']==2)// we already done if move == 'movesubmit', don't do it again
{
//LimeExpressionManager::JumpTo(-1, false, false, true);
LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions);
Expand Down

6 comments on commit d9d3062

@apmuthu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should:
$thissurvey['questionindex']==2
be
$thissurvey['questionindex']>=2
?

Is is okay to backport to v2.05 since you said in the bug #09906 you had fixed it for it earlier?

@Shnoulle
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

questionindex == 2 or >= 2 : actually we only support 0,1,2 . I don't know what we do for 3.

2.05 is not updated actualy.

@apmuthu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info. Can keep it in mind when another numbered feature is used in the code.

@apmuthu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I include this commit into v2.05 - will it break anything?

@Shnoulle
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this fix is OK in last 2.05.

@apmuthu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Committed.
apmuthu@c9717e1

Please sign in to comment.