Subversion Repositories wimsdev

Rev

Rev 13816 | Rev 13876 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

!!! Rg$i contains the data for questions embeddings of
!!! exercise $i (one line for each question)
!!! ans_$i contains the data for the answer
!set prompt_empty=___________

!advance prcnt
!if $prcnt>6 and $wims_user!=supervisor
  error=too_many_print
  printing=yes
  !exit
!endif

printmax=40
!reset savedrawcnt print
printing=yes
exo=!listintersect $exo and $exolist
!default exo=$defaultlist
wims_intro_parm=$exo
!default exo=$exolist
exo_cnt=!itemcnt $exo
!!at least 1 exercise of each type
!if $random=0
  exo_=!makelist x for x=1 to $exo_cnt
!else
  exo_=!shuffle $exo_cnt
!endif
qnum1=$[$qnum-$exo_cnt]
!if $qnum1 >= 1
  exo__=!randint 1,$exo_cnt repeat $qnum1
  exo_=$exo_,$exo__
!endif
exo=$(exo[$(exo_)])
exo=!item 1 to $printmax of $exo
n=!itemcnt $exo

!if $n<1
  !exit
!endif

M=0
m_step=1
test_print=0
!if $wims_developer!= or $wims_user=supervisor
  latex_exists=0
  !readproc oef/latex.proc begin
!else
  latex_exists=-1
!endif

!for i=1 to $n
  question_$i=
  e_=!item $i of $exo
  name_$i=$e_
  !if $lang_choice!=$empty
    title_$i=!defof title_$lang_choice in $(class_header)def/$e_.def
  !else
    title_$i=!defof title_$lang in $(class_header)def/$e_.def
  !endif
  !if $(title_$i)=$empty
    title_$i=!defof title in $(class_header)def/$e_.def
  !endif
  !reset question testcondition format
  thisexo=$e_
  !readproc oef/imagedir.proc
  varcnt=!defof varcnt in $(class_header)def/$e_.def
  !default varcnt=0
  !for v=2 to $varcnt+5
    val$v=
  !next v
  status=prep
  !read $(class_header)def/$e_.def
  !if $format=html
    question_$i=$question
    !if __EXECUTED_ isin $question
      varcnt_$i=$varcnt
      var_$i=$val1
      !for v=2 to $varcnt+5
        v_=!translate internal $\
$ to $  $ in $(val$v)
        var_$i=$(var_$i)\
$v_
      !next v
    !endif
    !ifval $replycnt=0 and $choicecnt=1
      rep=!item 1 to 6 of $choicebad1
      rep=!append item $choicegood1 to $rep
      rep=!listuniq $rep
      rep=!sort items $rep
      rep=!replace , by </li><li> in <ul style="list-style-type: square;"><li>$rep</li></ul>
      chce_$i=$rep
      test_print=1
    !else
      chce_$i=
    !endif
    rep=
    !!FIXME
    !if 3 isin $intro_check or $intro_check=$empty
      !for k=1 to $choicecnt
        !if $(choicename$k)!=
          rep=!append line <em>$(choicename$k)</em>: $(choicegood$k) to $rep
        !else
          rep=!append line $(choicegood$k) to $rep
        !endif
      !next k
      !for k=1 to $replycnt
        thisstep=!line 1 of $oefsteps
        !if r$k isitemof $thisstep or $oefsteps=$empty
          rg_=$(replygood$k)
          Replytype$i=!append item $(replytype$k) to $(Replytype$i)
          Replystyle$i=!append item $anstyle to $(Replystyle$i)
          !if $(replytype$k) iswordof checkbox mark click menu radio clickfill dragfill
            rg_=!rows2lines $rg_
            rg1_=!line 1 of $rg_
            rg2_=!line 2 to -1 of $rg_
            rg2_=!translate internal $\
$ to ; in $rg2_
            !if $(replytype$k) iswordof checkbox mark click menu radio
              rg_=!item $rg1_ of $rg2_
            !else
              rg_=$rg1_
            !endif
            rg_tmp=$rg2_
            !if $(replytype$k) iswordof clickfill dragfill
              rg_tmp=!listuniq $rg1_,$rg2_
            !endif
            Rg$i=!append line $rg_tmp to $(Rg$i)
            !goto endRg
          !endif

          !if $(replytype$k) iswordof coord
            rg_=<img src="$(rg_[1;])" />
            Rg$i=!append line $rg_ to $(Rg$i)
            !goto endRg
          !endif

          !if $(replytype$k) iswordof atext wlist nocase case
            rg_=!translate internal ;| to $\
\
$ in $rg_
            rg_=!line 1 of $rg_
          !endif
          !if $(replytype$k) iswordof function default equation sigunits numexp or $(replystyle$k) iswordof numeric
            rg_=!item 1 of $rg_
            Rg$i=!append line $ $ to $(Rg$i)
            !goto endRg
          !endif

          !if $(replytype$k) iswordof imgcomp textcomp compose reorder
            rg_=!translate internal | to $\
$ in $rg_
            rg_=!rows2lines $rg_
            rg_tmp=!lines2items $rg_
            rg_=!line 1 of $rg_
            !if $(replytype$k)=imgcomp
              rg_=!item 2 to -1 of $rg_
              rg_=!nospace $rg_
              rg_=!replace , by " />,<img src="$imagedir/ in <img src="$imagedir/$rg_" />
              rg__=!shuffle $rg_
              Rg$i=!append line $rg__ to $(Rg$i)
            !else
              rg_cnt_=!itemcnt $rg_tmp
              rg__=!shuffle $rg_cnt_
              rg_tmp=!listuniq $(rg_tmp[$rg__])
              Rg$i=!append line $rg_tmp to $(Rg$i)
              !goto endRg
            !endif
            rg_=!translate , to $ $ in $rg_
          !endif

          !if $(replytype$k) iswordof correspond
            !set rg__=!replace internal ; by $\
$ in $rg_
            !distribute lines $rg__ into rg1__,rg2__
            !set rg__cnt=!itemcnt $rg1__
            !set rg_2_=!shuffle $rg__cnt
            !set rg__=<table class="wimsborder"><tr>
            !set rgg_=<table class="wimsborder"><tr>
            !for tmp=1 to $rg__cnt
              !set rg__=$rg__<td>$(rg1__[$tmp])</td>
              !set rgg_=$rgg_<td>$(rg_[1;$tmp])</td>
            !next
            !set rg__=$rg__</tr><tr>
            !set rgg_=$rgg_</tr><tr>
            !for tmp =1 to $rg__cnt
              !set rg__=$rg__<td>$(rg2__[$(rg_2_[$tmp])])</td>
              !set rgg_=$rgg_<td>$(rg2__[$tmp])</td>
            !next
            !set rg__=$rg__</tr></table>
            !set rg_=$rgg_</tr></table>
            Rg$i=!append line $(rg__) to $(Rg$i)
            !goto endRg
          !endif

          !if $(replytype$k) iswordof draw
            rg__=$(rg_[2;])
            tmp=!item 1 of $rg__
            !if $tmp=arrows
              !default arrow_head=10
              arrow_head=!getopt arrowhead in $(replyoption$k)
              comp=,$arrow_head
            !endif
            rg__=!replace internal $tmp by $tmp blue$comp in $rg__
            !reset comp
            rg_=!declosing $(rg_[1;])
            !! FIXME inputsize is in the field embed not accessible here
            rg_=200,200$        $ $rg_
            !readproc oef/canvasdraw.phtml $rg_
            canvasdraw=!replace internal $\
$ by in $canvasdraw_out
            Rg$i=!append line $canvasdraw to $(Rg$i)
            !readproc oef/canvasdraw.phtml $rg_$        $ $rg__
            rg_=!replace internal $\
$ by in $canvasdraw_out
            !goto endRg
          !endif

          Rg$i=!append line $ $ to $(Rg$i)
:endRg
          !if $conditioncnt<1
            !if noanalyzeprint notwordof $(replyoption$k)
              !if $(replyname$k)$rg_ !=
                !if http isin $(replyname$k)$rg_
                  rep=$rg_
                !else
                  !if $(replyname$k)!=
                    rep=!append line <em>$(replyname$k)</em>: $rg_ to $rep
                  !else
                    rep=!append line $rg_ to $rep
                  !endif
                !endif
              !endif
            !endif
          !endif
        !else
          Replytype$i=!append item $(replytype$k) to $(Replytype$i)
          Replystyle$i=!append item $(replystyle$k) to $(Replystyle$i)
        !endif r$k isitemof $thisstep
        !reset replyoption$k
      !next k
    !endif intro_check
    rep=!imgrename $rep
    ans_$i=!trim $rep
    !if $(ans_$i)!=
      test_print=1
    !endif
  !endif html
  !reset intro_check
  !if $latex_exists>=0
    !readproc oef/latex.proc exo
  !endif
  Rg$i=!imgrename $(Rg$i)
!next i
!if $latex_exists>=1
  !readproc oef/latex.proc end
!endif