Source

webwork / src / java / template / archive / simple / checkboxlist.vm

#set( $items = $parameters.list )
#if( $items )
    #set( $itemCount = 0 )
    #foreach( $item in $items )
        #set( $itemCount = $itemCount + 1)
        $stack.push($item)
        #if( $parameters.listKey )
            #set( $itemKey = $stack.findValue($parameters.listKey) )
        #else
            #set( $itemKey = $item )
        #end
        #if( $parameters.listValue )
            #set( $itemValue  = $stack.findValue($parameters.listValue) )
        #else
            #set( $itemValue = $item )
        #end
        <input type="checkbox" name="$!webwork.htmlEncode($parameters.name)" value="$!webwork.htmlEncode($itemKey)"
        #parse("/$parameters.templateDir/simple/scripting-events.vm")
        id="$!webwork.htmlEncode($parameters.name)-$itemCount" #if( $tag.contains($parameters.nameValue, $itemKey) ) checked="checked" #end/>
        <label for="$!webwork.htmlEncode($parameters.name)-$itemCount" class="checkboxLabel">$!webwork.htmlEncode($itemValue)</label><br />
        #set ($trash = $stack.pop())
    #end
#else
  &nbsp;
#end