1
0
Fork 0

[DEV-3866] changes related to new "checkbox" question type

master
Joseph Frazer 2018-11-05 12:35:57 -05:00
commit 7b3c56e4a3
2 changed files with 12 additions and 10 deletions

View File

@ -1,7 +1,7 @@
/** /**
* General UI logic for steps * General UI logic for steps
* *
* Copyright (C) 2015 R-T Specialty, LLC. * Copyright (C) 2015, 2018 R-T Specialty, LLC.
* *
* This file is part of liza. * This file is part of liza.
* *
@ -343,20 +343,21 @@ module.exports = Class( 'GeneralStepUi' )
|| $element.attr( 'type' ) === 'checkbox' || $element.attr( 'type' ) === 'checkbox'
) )
{ {
// if it's not checked, then this isn't the radio we're
// interested in. Sorry! // 2 in this instance is the yes/no group length.
if ( !( $element.attr( 'checked' ) ) ) var group_length = $element.attr( 'data-question-length' )
? +$element.attr( 'data-question-length' )
: 2;
// if it's not checked and in a group, then this isn't
// the radio we're interested in. Sorry!
if ( !( $element.attr( 'checked' ) ) && group_length !== 1 )
{ {
$element.attr( 'checked', true ); $element.attr( 'checked', true );
return; return;
} }
// 2 in this instance is the yes/no group length.
var group_length = $element.attr( 'data-question-length' )
? $element.attr( 'data-question-length' )
: 2;
index = Math.floor( index / group_length ); index = Math.floor( index / group_length );
} }

View File

@ -1,7 +1,7 @@
/** /**
* Standard formatters * Standard formatters
* *
* Copyright (C) 2017 R-T Specialty, LLC. * Copyright (C) 2017, 2018 R-T Specialty, LLC.
* *
* This file is part of the Liza Data Collection Framework. * This file is part of the Liza Data Collection Framework.
* *
@ -81,6 +81,7 @@ module.exports = function( type_map )
explain: formatter.VoidFormatter, explain: formatter.VoidFormatter,
dateTime: formatter.VoidFormatter, dateTime: formatter.VoidFormatter,
waitable: formatter.VoidFormatter, waitable: formatter.VoidFormatter,
checkbox: formatter.VoidFormatter,
/* TODO:*/ /* TODO:*/
state: formatter.VoidFormatter, state: formatter.VoidFormatter,