public int getMaxNumber() { int iNumber = 1; RenderHotspot oRender = QTIUtil.getRenderHotspot((Item) getBeanObject()); if (oRender != null) { iNumber = oRender.getMaxNumber(); } if (iNumber <= 0) iNumber = -1; return iNumber; }
protected void setResponseNumber(Item oItem, int iMinNumber, int iMaxNumber) { QTISuperResponse oResponse = QTIUtil.getResponse(oItem); RenderHotspot oRender = QTIUtil.getRenderHotspot(oResponse); if (oRender != null) { if (iMinNumber > iMaxNumber) iMinNumber = iMaxNumber; oRender.setMinNumber(iMinNumber); oRender.setMaxNumber(iMaxNumber); if (iMaxNumber == 1) { oResponse.setCardinality("Single"); } else { oResponse.setCardinality("Multiple"); } } }
protected void setBackgroundImage(Item oItem, String sURI, int iWidth, int iHeight) { RenderHotspot oRender = QTIUtil.getRenderHotspot(oItem); if (oRender != null && sURI != null) { Material oMaterial = QTIUtil.getFirstMaterial(oRender); if (oMaterial != null) { Matimage oMat = QTIUtil.getMatimage(oMaterial); if (oMat != null) { oMat.setURI(sURI); oMat.setWidth(iWidth); oMat.setHeight(iHeight); } } else { oMaterial = Material.createWithMatimage(null, sURI, iWidth, iHeight); oRender.addMaterial(oMaterial); oRender.setObjectPosition( oRender.getContents(), oMaterial, oRender.getContentPosition(oMaterial), 0); } } }
protected void setHotspotType(Item oItem, String sType) { String sCurrentType = getHotspotType(); if (!sCurrentType.equals(sType)) { RenderHotspot oRender = QTIUtil.getRenderHotspot(oItem); if (oRender != null) { if (ZONE_HOTSPOT_TYPE.equals(sType)) { oRender.setShowDraw("No"); oRender.setShowOptions("Yes"); oRender.setTransp("Yes"); } else if (OPTION_HOTSPOT_TYPE.equals(sType)) { oRender.setShowDraw("No"); oRender.setShowOptions("Yes"); oRender.setTransp("No"); } else if (DOT_HOTSPOT_TYPE.equals(sType)) { oRender.setShowDraw("Yes"); oRender.setShowOptions("Yes"); oRender.setTransp("No"); } else if (FREE_HOTSPOT_TYPE.equals(sType)) { oRender.setShowDraw("No"); oRender.setShowOptions("No"); oRender.setTransp("No"); } QVHotspotListControl.updateConditions(mainBean.request, oItem); } } }