<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:og="hybs-taglib.tld"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	version="2.0">
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8" />

<!-- Required Parameter AN02_UNIQ(String),NOKAITO -->

<og:value command="REMOVE" key="KAISETSU" />
<og:value command="SQL">
	select	A.USERID
			,A.CDANK
			,A.CDSITSU
			,A.KBUNRUI
			,A.KAISETSU
			,'{@SYS.SYSTEM_ID}_'||A.CDANK||'_'||A.CDSITSU CLM
	from AN02 A
	where UNIQ = '{@AN02_UNIQ}'
</og:value>

<og:value command="SQL">
	select A.KVAL KVAL_ANSWER, A.KNAME KNAME_ANSWER, A.SUPOINT, A.FGCORRECT
	from AN12 A
	where A.NOKAITO = '{@NOKAITO}'
	and A.CDSITSU = '{@CDSITSU}'
	and A.FGJ = '1'
</og:value>

<og:value command="REMOVE" key="IMGKVAL_ANSWER" />
<og:value command="REMOVE" key="FGIMGK_ANSWER" />
<og:value command="SQL">
	select
		A.IMGKVAL IMGKVAL_ANSWER
		,case when A.IMGKVAL like '%.png' or A.IMGKVAL like '%.PNG'
			or A.IMGKVAL like '%.jpg' or A.IMGKVAL like '%.JPG'
			or A.IMGKVAL like '%.jpeg' or A.IMGKVAL like '%.JPEG'
			or A.IMGKVAL like '%.gif' or A.IMGKVAL like '%.GIF'
			or A.IMGKVAL like '%.bmp' or A.IMGKVAL like '%.BMP' then '1' else '0' end FGIMGK_ANSWER
	from AN03 A
	where A.USERID = '{@USERID}'
	and A.CDANK = '{@CDANK}'
	and A.CDSITSU = '{@CDSITSU}'
	and A.KVAL = '{@KVAL_ANSWER}'
	and A.FGJ = '1'
</og:value>

<og:equals val1="{@FGCORRECT}" val2="1" notEquals="true">
	<og:value command="REMOVE" key="IMGKVAL_CORRECT" />
	<og:value command="REMOVE" key="FGIMGK_CORRECT" />
	<og:value command="SQL">
		select
			A.KNAME KNAME_CORRECT,A.IMGKVAL IMGKVAL_CORRECT
			,case when A.IMGKVAL like '%.png' or A.IMGKVAL like '%.PNG'
				or A.IMGKVAL like '%.jpg' or A.IMGKVAL like '%.JPG'
				or A.IMGKVAL like '%.jpeg' or A.IMGKVAL like '%.JPEG'
				or A.IMGKVAL like '%.gif' or A.IMGKVAL like '%.GIF'
				or A.IMGKVAL like '%.bmp' or A.IMGKVAL like '%.BMP' then '1' else '0' end FGIMGK_CORRECT
		from AN03 A
		where A.USERID = '{@USERID}'
		and A.CDANK = '{@CDANK}'
		and A.CDSITSU = '{@CDSITSU}'
		and A.FGCORRECT = '1'
		and A.FGJ = '1'
	</og:value>
</og:equals>

<li>
	<!-- ANM0035:回答 : -->
	<og:text>{@LBL.ANM0035}</og:text>&amp;nbsp;&amp;nbsp;
	<og:column name="{@CLM}" value="{@KNAME_ANSWER}" td="false" writable="false" />
	<og:equals val1="{@IMGKVAL_ANSWER}" nullCheck="true" notEquals="true">
		<og:text>
		<a href="/{@SYS.CONTEXT_NAME}/ankimages/{@IMGKVAL_ANSWER}" target="IMAGE">
			<og:equals val1="{@FGIMGK_ANSWER}" val2="1">
				<img src="/{@SYS.CONTEXT_NAME}/ankimages/{@IMGKVAL_ANSWER}" width="50px" height="50px" alt="{@KNAME_ANSWER}" />
			</og:equals>
			<og:equals val1="{@FGIMGK_ANSWER}" val2="0">
				<img src="/{@SYS.CONTEXT_NAME}/jsp/image/text.gif" width="30px" height="30px" />
			</og:equals>
		</a>
		</og:text>
	</og:equals>

	&amp;nbsp;&amp;nbsp;
	<og:equals val1="{@FGCORRECT}" val2="1" notEquals="true">
		<!-- ANM0032:不正解です。 -->
		<span style="color:red; "><b><og:text>{@LBL.ANM0032}</og:text></b></span>
	</og:equals>
	<og:equals val1="{@FGCORRECT}" val2="1">
		<!-- ANM0033:正解です！( {0} 点 ) -->
		<span style="color:blue;"><b><og:text>{@LBL.ANM0033 @SUPOINT}</og:text></b></span>
	</og:equals>

	<og:equals val1="{@FGCORRECT}" val2="1" notEquals="true">
		<br /><br />
		<!-- ANM0034:正解 : -->
		<og:text>{@LBL.ANM0034}</og:text>&amp;nbsp;&amp;nbsp;
		<og:column name="{@CLM}" value="{@KNAME_CORRECT}" td="false" writable="false" />
		<og:equals val1="{@IMGKVAL_CORRECT}" nullCheck="true" notEquals="true">
			<og:text>
			<a href="/{@SYS.CONTEXT_NAME}/ankimages/{@IMGKVAL_CORRECT}" target="IMAGE">
				<og:equals val1="{@FGIMGK_CORRECT}" val2="1">
					<img src="/{@SYS.CONTEXT_NAME}/ankimages/{@IMGKVAL_CORRECT}" width="50px" height="50px" alt="{@KNAME_CORRECT}" />
				</og:equals>
				<og:equals val1="{@FGIMGK_CORRECT}" val2="0">
					<img src="/{@SYS.CONTEXT_NAME}/jsp/image/text.gif" width="30px" height="30px" />
				</og:equals>
			</a>
			</og:text>
		</og:equals>
	</og:equals>

	<br /><br />
	&amp;nbsp;<b><i>-<og:text>{@LBL.KAISETSU}</og:text>-</i></b>
	<br />
	<og:column name="KAISETSU" value="{@KAISETSU}" td="false" writable="false" renderer="PRE" />
</li>

</jsp:root>
