@@ 260-268 (lines=9) @@ | ||
257 | * |
|
258 | * @return string |
|
259 | */ |
|
260 | public static function answer_shortcode( $atts, $content = null ) { |
|
261 | if ( self::is_javascript_unavailable() ) { |
|
262 | return self::noscript_info(); |
|
263 | } |
|
264 | ||
265 | return isset( $atts['quiz_item'] ) |
|
266 | ? '<div class="jetpack-quiz-answer answer" data-correct="1">' . self::do_shortcode( $content ) . '</div>' |
|
267 | : ''; |
|
268 | } |
|
269 | ||
270 | /** |
|
271 | * Render wrong response. |
|
@@ 280-288 (lines=9) @@ | ||
277 | * |
|
278 | * @return string |
|
279 | */ |
|
280 | public static function wrong_shortcode( $atts, $content = null ) { |
|
281 | if ( self::is_javascript_unavailable() ) { |
|
282 | return self::noscript_info(); |
|
283 | } |
|
284 | ||
285 | return isset( $atts['quiz_item'] ) |
|
286 | ? '<div class="jetpack-quiz-answer answer">' . self::do_shortcode( $content ) . '</div>' |
|
287 | : ''; |
|
288 | } |
|
289 | ||
290 | /** |
|
291 | * Render explanation for wrong or right answer. |
|
@@ 300-308 (lines=9) @@ | ||
297 | * |
|
298 | * @return string |
|
299 | */ |
|
300 | public static function explanation_shortcode( $atts, $content = null ) { |
|
301 | if ( self::is_javascript_unavailable() ) { |
|
302 | return self::noscript_info(); |
|
303 | } |
|
304 | ||
305 | return isset( $atts['quiz_item'] ) |
|
306 | ? '<div class="jetpack-quiz-explanation explanation">' . self::do_shortcode( $content ) . '</div>' |
|
307 | : ''; |
|
308 | } |
|
309 | } |
|
310 | ||
311 | Quiz_Shortcode::init(); |