• Resolved skrubalov

    (@skrubalov)


    I see that this is deprecated since version 14.14. What can i use to replace it ?
    here is part of additional functionality

    if (( $cformsdata['id']==3 ) && ( $setting == "successMessage"  || $setting == "autoConfHTML" || $setting == "autoConfTXT" || $setting == "adminEmailHTML" || $setting == "adminEmailTXT")) {
     
    		### note: '$$$mypick' references the ID of the HTML element and has been assigned
                    ### to the drop down field in the form configuration, with [id:mypick] !
    		$form   = $cformsdata['data'];
    
    		$totalCorrect = 0;
    		$total = 0;
     		for ($i = 3; $i <= 28; $i++) {
    		         $curField = 'cf_form3_$$$' . $i;
    		         $totalCorrect += $form['cf_form3_' . $form[$curField]];
                             $total++;
     		}
                    $percent = ($totalCorrect / 20) * 100;
                    $yourScore = "<p>You scored " . $totalCorrect . " out of 20.  That's " . $percent . "%!</p>";
    				$edenDetails = "<p> XYZ School of English</p><p>Tel: +353 01 123456789</p><p>Email: [email protected]</p>";
    		
    
    		if ( $percent <=34 )
    	        return '<div class="formResult">' . $yourScore . ' <p>Your level is Elementary.</p>' . $oldvalue  . '</div>' ;					  
    			    elseif ( $percent <= 50 )
    	                return '<div class="formResult">' . $yourScore . ' <p>Your level is Pre-intermediate.</p>' . $oldvalue  . '</div>' ;
    				elseif ( $percent <= 70 )
                        return '<div class="formResult">' . $yourScore . ' <p>Your level is Intermediate</p>' . $oldvalue  . '</div>' ;
    				elseif ( $percent <= 89 )
                        return '<div class="formResult">' . $yourScore . ' <p>Your level is Upper-Intermediate</p>' . $oldvalue  . '</div>' ;
    				else 
                        return '<div class="formResult">' . $yourScore . ' <p>Your level is Advanced</p>' . $oldvalue  . '</div>' ;	
    
    	}
Viewing 1 replies (of 1 total)
  • Plugin Author bgermann

    (@bgermann)

    You could use cforms2_after_processing_action to calculate the score and save it in the session. Then use cforms2_usermessage_filter to output the according message.

Viewing 1 replies (of 1 total)
  • The topic ‘my_cforms_logic in 14.14’ is closed to new replies.