@@ -110,9 +110,12 @@ |
||
| 110 | 110 | ?> |
| 111 | 111 | |
| 112 | 112 | </form> |
| 113 | - <?php else: ?> |
|
| 113 | + <?php else { |
|
| 114 | + : ?> |
|
| 114 | 115 | |
| 115 | - <div class="sensei-message alert"> <?php _e( 'There are no questions for this Quiz yet. Check back soon.', 'woothemes-sensei' ); ?></div> |
|
| 116 | + <div class="sensei-message alert"> <?php _e( 'There are no questions for this Quiz yet. Check back soon.', 'woothemes-sensei' ); |
|
| 117 | +} |
|
| 118 | +?></div> |
|
| 116 | 119 | |
| 117 | 120 | <?php endif; // End If have questions ?> |
| 118 | 121 | |
@@ -1,5 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Sensei Lessons Class |
@@ -380,8 +383,7 @@ discard block |
||
| 380 | 383 | $quiz_questions = Sensei()->lesson->lesson_quiz_questions( $quiz_id ); |
| 381 | 384 | if( 0 < count( $quiz_questions ) ) { |
| 382 | 385 | update_post_meta( $post_id, '_quiz_has_questions', '1' ); |
| 383 | - } |
|
| 384 | - else { |
|
| 386 | + } else { |
|
| 385 | 387 | delete_post_meta( $post_id, '_quiz_has_questions' ); |
| 386 | 388 | } |
| 387 | 389 | |
@@ -392,7 +394,9 @@ discard block |
||
| 392 | 394 | |
| 393 | 395 | public function get_submitted_setting_value( $field = false ) { |
| 394 | 396 | |
| 395 | - if( ! $field ) return; |
|
| 397 | + if( ! $field ) { |
|
| 398 | + return; |
|
| 399 | + } |
|
| 396 | 400 | |
| 397 | 401 | $value = false; |
| 398 | 402 | |
@@ -1509,7 +1513,7 @@ discard block |
||
| 1509 | 1513 | |
| 1510 | 1514 | $field_name = 'answer_feedback_boolean'; |
| 1511 | 1515 | |
| 1512 | - }elseif( 'multiple-choice' == $question_type ){ |
|
| 1516 | + } elseif( 'multiple-choice' == $question_type ){ |
|
| 1513 | 1517 | |
| 1514 | 1518 | $field_name = 'answer_feedback_multiple_choice'; |
| 1515 | 1519 | |
@@ -1605,7 +1609,9 @@ discard block |
||
| 1605 | 1609 | |
| 1606 | 1610 | $html = ''; |
| 1607 | 1611 | |
| 1608 | - if( ! $lesson_id && ! $quiz_id ) return $html; |
|
| 1612 | + if( ! $lesson_id && ! $quiz_id ) { |
|
| 1613 | + return $html; |
|
| 1614 | + } |
|
| 1609 | 1615 | |
| 1610 | 1616 | $settings = $this->get_quiz_settings( $quiz_id ); |
| 1611 | 1617 | |
@@ -2281,11 +2287,11 @@ discard block |
||
| 2281 | 2287 | |
| 2282 | 2288 | $answer_feedback = $data[ 'answer_feedback_boolean' ]; |
| 2283 | 2289 | |
| 2284 | - }elseif( isset( $data[ 'answer_feedback_multiple_choice' ] ) && !empty( $data[ 'answer_feedback_multiple_choice' ] ) ){ |
|
| 2290 | + } elseif( isset( $data[ 'answer_feedback_multiple_choice' ] ) && !empty( $data[ 'answer_feedback_multiple_choice' ] ) ){ |
|
| 2285 | 2291 | |
| 2286 | 2292 | $answer_feedback = $data[ 'answer_feedback_multiple_choice' ]; |
| 2287 | 2293 | |
| 2288 | - }elseif( isset( $data[ 'answer_feedback' ] ) ){ |
|
| 2294 | + } elseif( isset( $data[ 'answer_feedback' ] ) ){ |
|
| 2289 | 2295 | |
| 2290 | 2296 | $answer_feedback = $data[ 'answer_feedback' ]; |
| 2291 | 2297 | |
@@ -2298,8 +2304,7 @@ discard block |
||
| 2298 | 2304 | // Handle the extended question text |
| 2299 | 2305 | if ( isset( $data[ 'question_description' ] ) && ( '' != $data[ 'question_description' ] ) ) { |
| 2300 | 2306 | $post_content = $data[ 'question_description' ]; |
| 2301 | - } |
|
| 2302 | - else { |
|
| 2307 | + } else { |
|
| 2303 | 2308 | $post_content = ''; |
| 2304 | 2309 | } |
| 2305 | 2310 | // Question Query Arguments |
@@ -2507,8 +2512,7 @@ discard block |
||
| 2507 | 2512 | 'key' => '_lesson_course', |
| 2508 | 2513 | 'value' => $course_id, |
| 2509 | 2514 | ); |
| 2510 | - } |
|
| 2511 | - else { |
|
| 2515 | + } else { |
|
| 2512 | 2516 | // Simple check for connection to a Course |
| 2513 | 2517 | $post_args['meta_query'][] = array( |
| 2514 | 2518 | 'key' => '_lesson_course', |
@@ -2636,9 +2640,13 @@ discard block |
||
| 2636 | 2640 | // Fetch each question in the order in which they were asked |
| 2637 | 2641 | $questions = array(); |
| 2638 | 2642 | foreach( $selected_questions as $question_id ) { |
| 2639 | - if( ! $question_id ) continue; |
|
| 2643 | + if( ! $question_id ) { |
|
| 2644 | + continue; |
|
| 2645 | + } |
|
| 2640 | 2646 | $question = get_post( $question_id ); |
| 2641 | - if( ! isset( $question ) || ! isset( $question->ID ) ) continue; |
|
| 2647 | + if( ! isset( $question ) || ! isset( $question->ID ) ) { |
|
| 2648 | + continue; |
|
| 2649 | + } |
|
| 2642 | 2650 | $questions[] = $question; |
| 2643 | 2651 | } |
| 2644 | 2652 | |
@@ -2651,7 +2659,9 @@ discard block |
||
| 2651 | 2659 | |
| 2652 | 2660 | // Set array of questions that already exist so we can prevent duplicates from appearing |
| 2653 | 2661 | foreach( $questions_array as $question ) { |
| 2654 | - if( 'question' != $question->post_type ) continue; |
|
| 2662 | + if( 'question' != $question->post_type ) { |
|
| 2663 | + continue; |
|
| 2664 | + } |
|
| 2655 | 2665 | $existing_questions[] = $question->ID; |
| 2656 | 2666 | } |
| 2657 | 2667 | |
@@ -2691,7 +2701,9 @@ discard block |
||
| 2691 | 2701 | |
| 2692 | 2702 | // Add selected questions to existing questions array to prevent duplicates from being added |
| 2693 | 2703 | foreach( $questions_array as $cat_question ) { |
| 2694 | - if( in_array( $cat_question->ID, $existing_questions ) ) continue; |
|
| 2704 | + if( in_array( $cat_question->ID, $existing_questions ) ) { |
|
| 2705 | + continue; |
|
| 2706 | + } |
|
| 2695 | 2707 | $existing_questions[] = $cat_question->ID; |
| 2696 | 2708 | } |
| 2697 | 2709 | } |
@@ -3525,7 +3537,7 @@ discard block |
||
| 3525 | 3537 | |
| 3526 | 3538 | $message = sprintf( __( 'This is a preview lesson. Please purchase the %1$s before starting the lesson.', 'woothemes-sensei' ), $a_element ); |
| 3527 | 3539 | |
| 3528 | - }else{ |
|
| 3540 | + } else{ |
|
| 3529 | 3541 | |
| 3530 | 3542 | $message = sprintf( __( 'Please purchase the %1$s before starting the lesson.', 'woothemes-sensei' ), $a_element ); |
| 3531 | 3543 | |
@@ -3547,7 +3559,7 @@ discard block |
||
| 3547 | 3559 | |
| 3548 | 3560 | $message = sprintf( __( 'This is a preview lesson. Please purchase the %1$s before starting the lesson.', 'woothemes-sensei' ), $a_element ); |
| 3549 | 3561 | |
| 3550 | - }else{ |
|
| 3562 | + } else{ |
|
| 3551 | 3563 | |
| 3552 | 3564 | $message = sprintf( __( 'Please purchase the %1$s before starting the lesson.', 'woothemes-sensei' ), $a_element ); |
| 3553 | 3565 | |
@@ -1,5 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly. |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Sensei Course Component Widget |
@@ -251,7 +254,7 @@ discard block |
||
| 251 | 254 | |
| 252 | 255 | _e( 'You have no completed courses.', 'woothemes-sensei' ); |
| 253 | 256 | |
| 254 | - }else{
|
|
| 257 | + } else{
|
|
| 255 | 258 | |
| 256 | 259 | _e( 'You have no courses.', 'woothemes-sensei' ); |
| 257 | 260 | |