ONO::FW::Apps::Core::Check

This module offers helpers that allow to check if user answers in ONO apps are correct or not. Note that this is mostly the UI logic, and not the actual checking of the provided data.

Functions

check_custom();

Check mode: customizable

Switches:

-b display button at the bottom (inline buttons should be part of the code), may use BUTTON var
-B button -b is separated on top by a horizontal line
-C no class
-G green (correct answer)
-L loading icon
-R red (wrong answer)
-S no style
-T flat top
-Y yellow (incomplete answer, warning, etc...)

ONO::FW::Apps::Core::Check->check_custom( $CHECK, $switches, $CLASS, $STYLE, $BUTTON );
returns: qq~<div class="$CLASS"> <div class="box_$COLOR xlarge$CLASS2" style="$STYLE"> <div class="box_paper"> <table class="default_table auto"> <tr>$CHECK</tr> </table> $BUT </div> </div> </div> ~

check_demo_mode();

Check mode: demo mode option

ONO::FW::Apps::Core::Check->check_demo_mode( );

check_multi();

Check mode: multiple questions (standard mode)

Switches:

-n next_page / done buttons
-N undocumented (?)

ONO::FW::Apps::Core::Check->check_multi( $BLK_ref, $remaining, $page, $pages, $switches, $vars_ref );

check_rightwrong();

Check mode: right or wrong (special case)

ONO::FW::Apps::Core::Check->check_rightwrong( $is_wrong, $BLK_ref );
returns: qq~<div class="inline auto" style="min-width:320px">$ANS</div>~

check_single();

Check mode: single question (standard mode)

Switches:

-B put TDS Behind the input fields
-C correct answer displays continue button (see also: -f)
-d dual / double input fields
-f feedback color frame (status 1 = green, status 2 = red, see also: -C)
-F disable input field focus
-I no Input fields (check / continue buttons only)
-M no Margin top 75px
-n use number instead of text (auto-disable in comma mode)
-m maxlength affects number min/max (requires -n, does not work with negatives)
-P small padding, reducing overall height
-R radius10
-S auto-submit if -C and output_web_answer_status == 1, width output_web_next_question = 1
-T transparent is default
-y double zero answer 1 if -Z
-Y double zero answer 2 if -Z
-z set answers to zero (always)
-Z set answers to zero (only when showing results, also see -y/-Y)

output_web_answer_status:

-0 none
-1 correct
-2 wrong

ONO::FW::Apps::Core::Check->check_single( $TDS1, $TDS2, $width, $maxlength, $BLK_ref, $vars_ref, $switches, $devpla );

Sub-Modules

none

Dependencies

Code