Ignore:
Timestamp:
09/13/06 20:56:37 (6 years ago)
Author:
anp
Message:

preview des mcq

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Wsp_ModelingAssmnt/spaces/gen/modelBuilder/bs.doss/_common/sma/communPreview.xsl.xsl

    r6458 r6533  
    127127                        ex : hints, ...--> 
    128128        <xsl0:template name="tGetBaseTemplateView"> 
     129                <xsl0:param name="pNoMatch"/> 
    129130                <xsl0:param name="pTitle"/><!-- optionnel --> 
    130131                <xsl0:param name="pElementName"/><!-- optionnel --> 
     
    133134                <xsl0:param name="pConfCode"/><!-- optionnel --> 
    134135                <xsl0:param name="pMode"/><!-- content --> 
     136                <xsl0:param name="pCateg"/><!-- content --> 
    135137                 
    136138                <xsl0:variable name="vElementName"> 
     
    142144                        </xsl0:choose> 
    143145                </xsl0:variable> 
    144                 <xsl:template mode="{resultatAgent('//codeModel')}"> 
    145                         <xsl0:attribute name="match"><xsl0:value-of select="concat(si(string-length(normalize-space($pElementNamespace))&gt;0, concat($pElementNamespace, ':'), 'sc:'), $vElementName)"/></xsl0:attribute> 
     146                 
     147                <xsl0:variable name="vContent"> 
    146148                        <xsl0:if test="not(key('htmlPreviewBlocks', concat($vElementName, '_', $pConfCode))) or key('htmlPreviewBlocks', concat($vElementName, '_', $pConfCode))/@display='true'"> 
    147149                                <xsl0:variable name="vIsResDefined" select="boolean(key('htmlPreviewBlocks', concat($vElementName, '_', $pConfCode))/sm:iconBlock/@sc:refUri)"/> 
     
    174176                                                <treeBlockElement title="{@name}"> 
    175177                                                        <content level="+"> 
    176                                                                 <imgBlock categ="{normalize-space(@name)}"> 
     178                                                                <imgBlock categ="{si($pCateg, $pCateg, normalize-space(@name))}"> 
    177179                                                                        <xsl0:attribute name="src"> 
    178180                                                                                <xsl0:value-of select="$vUriResGen"/> 
     
    197199                                </xsl0:choose> 
    198200                        </xsl0:if> 
    199                 </xsl:template> 
     201                </xsl0:variable> 
     202                 
     203                <xsl0:choose> 
     204                        <xsl0:when test="$pNoMatch='true'"> 
     205                                <xsl0:copy-of select="$vContent"/> 
     206                        </xsl0:when> 
     207                        <xsl0:otherwise> 
     208                                <xsl:template mode="{resultatAgent('//codeModel')}"> 
     209                                        <xsl0:attribute name="match"><xsl0:value-of select="concat(si(string-length(normalize-space($pElementNamespace))&gt;0, concat($pElementNamespace, ':'), 'sc:'), $vElementName)"/></xsl0:attribute> 
     210                                <xsl0:copy-of select="$vContent"/> 
     211                                </xsl:template> 
     212                        </xsl0:otherwise> 
     213                </xsl0:choose> 
     214                         
     215        </xsl0:template> 
     216         
     217        <!-- hints --> 
     218        <xsl0:template match="sm:hintModel"> 
     219                <xsl0:call-template name="tGetBaseTemplateView"> 
     220                        <xsl0:with-param name="pTitle"> 
     221                                <xsl:if test="@cost"> 
     222                                        (<xsl0:value-of select="sm:hintCost/@name"/> : <xsl0:if test="sm:hintCost/sm:percentageLost">-</xsl0:if><xsl:value-of select="@cost"/><xsl0:if test="sm:hintCost/sm:percentageLost">%</xsl0:if>) 
     223                                </xsl:if> 
     224                        </xsl0:with-param> 
     225                </xsl0:call-template> 
     226        </xsl0:template> 
     227         
     228        <!-- feedback --> 
     229        <xsl0:template match="sm:feedbackModel"> 
     230                <xsl0:call-template name="tGetBaseTemplateView"> 
     231                        <xsl0:with-param name="pElementName">feedbacks</xsl0:with-param> 
     232                        <xsl0:with-param name="pContent"> 
     233                                <xsl0:apply-templates/> 
     234                        </xsl0:with-param> 
     235                </xsl0:call-template> 
     236        </xsl0:template> 
     237         
     238        <xsl0:template match="sm:scaledScoreIntervals | sm:pointScoreIntervals"> 
     239                <xsl:for-each select="sc:feedback"> 
     240                        <treeBlockElement> 
     241                                <imgBlock src=""> 
     242                                        <titleBlock><xsl0:value-of select="sm:interval/@name"/> 
     243                                                <xsl:if test="@gt or @get or @lt or @let">&#160;:&#160;</xsl:if> 
     244                                                <xsl:if test="@gt"> 
     245                                                        <xsl0:value-of select="sm:interval/sm:scoreMoreThan/@name"/> 
     246                                                        <xsl:text>&#160;</xsl:text> 
     247                                                        <xsl0:choose> 
     248                                                                <xsl0:when test="local-name()='scaledScoreIntervals'"> 
     249                                                                        <xsl:call-template name="t_scaledScoreIntervals"><xsl:with-param name="pScore" select="@gt"/></xsl:call-template> 
     250                                                                </xsl0:when> 
     251                                                                <xsl0:otherwise><xsl:value-of select="@gt"/></xsl0:otherwise> 
     252                                                        </xsl0:choose> 
     253                                                        <xsl:if test="@gt"><xsl:text>&#160;et&#160;</xsl:text></xsl:if> 
     254                                                </xsl:if> 
     255                                                <xsl:if test="@get"> 
     256                                                        <xsl0:value-of select="sm:interval/sm:scoreMoreOrEqualThan/@name"/> 
     257                                                        <xsl:text>&#160;</xsl:text> 
     258                                                        <xsl0:choose> 
     259                                                                <xsl0:when test="local-name()='scaledScoreIntervals'"> 
     260                                                                        <xsl:call-template name="t_scaledScoreIntervals"><xsl:with-param name="pScore" select="@get"/></xsl:call-template> 
     261                                                                </xsl0:when> 
     262                                                                <xsl0:otherwise><xsl:value-of select="@get"/></xsl0:otherwise> 
     263                                                        </xsl0:choose> 
     264                                                </xsl:if> 
     265                                                <xsl:if test="@lt"> 
     266                                                        <xsl:if test="@gt or @get"><xsl:text>&#160;et&#160;</xsl:text></xsl:if> 
     267                                                        <xsl0:value-of select="sm:interval/sm:scoreLessThan/@name"/> 
     268                                                        <xsl:text>&#160;</xsl:text> 
     269                                                        <xsl0:choose> 
     270                                                                <xsl0:when test="local-name()='scaledScoreIntervals'"> 
     271                                                                        <xsl:call-template name="t_scaledScoreIntervals"><xsl:with-param name="pScore" select="@lt"/></xsl:call-template> 
     272                                                                </xsl0:when> 
     273                                                                <xsl0:otherwise><xsl:value-of select="@lt"/></xsl0:otherwise> 
     274                                                        </xsl0:choose> 
     275                                                </xsl:if> 
     276                                                <xsl:if test="@let"> 
     277                                                        <xsl:if test="@gt or @get"><xsl:text>&#160;et&#160;</xsl:text></xsl:if> 
     278                                                        <xsl0:value-of select="sm:interval/sm:scoreLessOrEqualThan/@name"/> 
     279                                                        <xsl:text>&#160;</xsl:text> 
     280                                                        <xsl0:choose> 
     281                                                                <xsl0:when test="local-name()='scaledScoreIntervals'"> 
     282                                                                        <xsl:call-template name="t_scaledScoreIntervals"><xsl:with-param name="pScore" select="@let"/></xsl:call-template> 
     283                                                                </xsl0:when> 
     284                                                                <xsl0:otherwise><xsl:value-of select="@let"/></xsl0:otherwise> 
     285                                                        </xsl0:choose> 
     286                                                </xsl:if> 
     287                                        </titleBlock> 
     288                                </imgBlock> 
     289                                <indent> 
     290                                        <xsl0:variable name="vAgtModel" select="concat('@', getIdFromPath(../@sc:refUri))"/> 
     291                                        <xsl:call-template name="{resultatAgent(concat($vAgtModel, '/codeModel'))}"><xsl:with-param name="pVisu">content</xsl:with-param></xsl:call-template> 
     292                                </indent> 
     293                        </treeBlockElement>              
     294                </xsl:for-each> 
     295        </xsl0:template> 
     296         
     297        <!-- scoreBounds --> 
     298        <xsl0:template match="sm:scoreBounds"> 
     299                <xsl0:call-template name="tGetBaseTemplateView"> 
     300                        <xsl0:with-param name="pElementName">score</xsl0:with-param> 
     301                        <xsl0:with-param name="pContent"> 
     302                                <xsl0:for-each select="*"> 
     303                                        <treeBlockElement> 
     304                                                <imgBlock src=""> 
     305                                                        <titleBlock><xsl0:value-of select="@name"/></titleBlock> 
     306                                                        <xsl:call-template name="{concat('t_', local-name())}"> 
     307                                                                <xsl:with-param name="pScore" select="{si(local-name()='pointsIfAllIsRight', '@max', '@min')}"/> 
     308                                                        </xsl:call-template> 
     309                                                </imgBlock> 
     310                                        </treeBlockElement> 
     311                                </xsl0:for-each> 
     312                        </xsl0:with-param> 
     313                </xsl0:call-template> 
    200314        </xsl0:template> 
    201315         
Note: See TracChangeset for help on using the changeset viewer.