| @@ 241-249 (lines=9) @@ | ||
| 238 | * |
|
| 239 | * @return string |
|
| 240 | */ |
|
| 241 | public static function answer_shortcode( $atts, $content = null ) { |
|
| 242 | if ( self::is_javascript_unavailable() ) { |
|
| 243 | return self::noscript_info(); |
|
| 244 | } |
|
| 245 | ||
| 246 | return isset( $atts['quiz_item'] ) |
|
| 247 | ? '<div class="answer" data-correct="1">' . self::do_shortcode( $content ) . '</div>' |
|
| 248 | : ''; |
|
| 249 | } |
|
| 250 | ||
| 251 | /** |
|
| 252 | * Render wrong response. |
|
| @@ 261-269 (lines=9) @@ | ||
| 258 | * |
|
| 259 | * @return string |
|
| 260 | */ |
|
| 261 | public static function wrong_shortcode( $atts, $content = null ) { |
|
| 262 | if ( self::is_javascript_unavailable() ) { |
|
| 263 | return self::noscript_info(); |
|
| 264 | } |
|
| 265 | ||
| 266 | return isset( $atts['quiz_item'] ) |
|
| 267 | ? '<div class="answer">' . self::do_shortcode( $content ) . '</div>' |
|
| 268 | : ''; |
|
| 269 | } |
|
| 270 | ||
| 271 | /** |
|
| 272 | * Render explanation for wrong or right answer. |
|
| @@ 281-289 (lines=9) @@ | ||
| 278 | * |
|
| 279 | * @return string |
|
| 280 | */ |
|
| 281 | public static function explanation_shortcode( $atts, $content = null ) { |
|
| 282 | if ( self::is_javascript_unavailable() ) { |
|
| 283 | return self::noscript_info(); |
|
| 284 | } |
|
| 285 | ||
| 286 | return isset( $atts['quiz_item'] ) |
|
| 287 | ? '<div class="explanation">' . self::do_shortcode( $content ) . '</div>' |
|
| 288 | : ''; |
|
| 289 | } |
|
| 290 | } |
|
| 291 | ||
| 292 | Quiz_Shortcode::init(); |
|