EduploneExam/skins/EduploneExam exam_finished.pt,NONE,1.1 exam_freetext.pt,NONE,1.1 exam_matching.pt,NONE,1.1 exam_math.pt,NONE,1.1 exam_texttask.pt,NONE,1.1

Nils Haagen <[email protected]>
Newsgroups gmane.comp.web.zope.eduplone.cvs
Message-ID <[email protected]>
Update of /cvsroot/eduplone/EduploneExam/skins/EduploneExam
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20147/skins/EduploneExam

Added Files:
	exam_finished.pt exam_freetext.pt exam_matching.pt 
	exam_math.pt exam_texttask.pt 
Log Message:
interface-work and corrections on the result-views

--- NEW FILE: exam_texttask.pt ---
 
<div metal:define-macro="view"
       tal:omit-tag="">

    <div>
                    
        <h2 tal:content="currentQuestion/title" />
        <bR>
        <b tal:content="structure python:currentQuestion.getQuestion()" />
        <br/>
        <span tal:content="python: currentQuestion.getInstruction()" />
        
        <br/><br/>

        <tal:define tal:define="responseObj python: context.deliverResponse(currentQuestion, create=False)">
            <input type="text" 
                   tal:attributes="name  python:currentQuestion.UID();
                                   value python:responseObj[currentQuestion.UID()]">
        </tal:define>

    </div>

</div>


<div metal:define-macro="eval"
       tal:omit-tag="">

    <div>
                    
        <h2 tal:content="currentQuestion/title" />

        <span tal:content="structure python:currentQuestion.getQuestion()" />
      
        <br />

        <table border="0" 
               class="listing"
               summary="user result"
               tal:define="responseObj python: context.deliverResponse(currentQuestion, create=False)">

          <thead>
            <tr><th i18n:translate="label_useranswer">user answer</th>
                <th i18n:translate="label_correctanswer">correct answer</th>
                <th i18n:translate="label_is_this_correct">correct?</th>
            </tr>
          </thead>

          <tr>

            <td><input type="text" disabled="disabled"
                 tal:attributes="value python: responseObj[currentQuestion.UID()]" />
            </td>

            <td><tal:condition tal:condition="python:len(currentQuestion.contentValues()) > 0">
                    <tal:repeat tal:repeat="listitem python:currentQuestion.contentValues()[0].getCorrect()">
                        <i tal:content="listitem" />
                        <br />
                    </tal:repeat>
                </tal:condition>
            </td>

            <td><tal:condition tal:condition="python:len(currentQuestion.contentValues()) > 0">
                    <i tal:content="structure python: test(currentQuestion.contentValues()[0].processValue(responseObj[currentQuestion.UID()]), '<img src=right_answer.gif>', '<img src=wrong_answer.gif>')" />
                 </tal:condition>
            </td>
          </tr>
        </table>        

    </div>

</div>
--- NEW FILE: exam_matching.pt ---
 
<div metal:define-macro="view"
       tal:omit-tag="">

    <div>
                    
        <h2 tal:content="currentQuestion/title" />
        <bR />
        <b tal:content="structure python:currentQuestion.getQuestion()" />
        <br/>
        <span tal:content="python: currentQuestion.getInstruction()" />
        
        <br/><br/>

        <table border="0"
               tal:define="responseObj python: context.deliverResponse(currentQuestion, create=False)">

            <tal:repeat repeat="answer python:currentQuestion.contentValues()">               
                <tr tal:condition="answer/challange">
                    <td tal:content="answer/challange" />
                    <td width="10"></td>
                        <td>
                        <select tal:attributes="name python:'##'.join([currentQuestion.UID(), answer.UID()])">
                            <option value=""></option>
                            <option tal:repeat="correctAnswer python:currentQuestion.contentValues()"
                                    tal:attributes="value correctAnswer/correct;
                                                    selected python:test(correctAnswer.getCorrect() == responseObj[answer.UID()], 'selected', None)"
                                    tal:content="python:correctAnswer.getCorrect()">
                            </option>
                        </select>
                        </td>
                    </tr>     
            </tal:repeat>
        </table>

    </div>
</div>



<div metal:define-macro="eval"
       tal:omit-tag="">

    <div>
                    
        <h2 tal:content="currentQuestion/title" />

        <span tal:content="structure python:currentQuestion.getQuestion()" />
      
        <br/>

        <table border="0"
               class="listing"
               summary="user result" 
               tal:define="responseObj python: context.deliverResponse(currentQuestion, create=False)">


          <thead>
            <tr><th i18n:translate="label_challange">challange</th>
                <th i18n:translate="label_useranswer">user answer</th>
                <th i18n:translate="label_correctanswer">correct answer</th>
                <th i18n:translate="label_is_this_correct">correct?</th>
            </tr>
          </thead>


          <tr tal:repeat="answer python:currentQuestion.contentValues()">

            <tal:condition tal:condition="answer/challange">
                <td tal:content="python: answer.getChallange()" />

                <td>
                    <select disabled="disabled">
                        <option></option>
                        <option tal:repeat="correctAnswer python:currentQuestion.contentValues()"
                                tal:attributes="value correctAnswer/correct;
                                                selected python:test(correctAnswer.getCorrect() == responseObj[answer.UID()], 'selected', None)"
                                tal:content="python:correctAnswer.getCorrect()">
                        </option>
                    </select>
                </td>

                <td tal:content="python: answer.getCorrect()" />
                <td tal:content="structure python: test(answer.processValue(responseObj[answer.UID()]), '<img src=right_answer.gif>', '<img src=wrong_answer.gif>')" />
            </tal:condition>    
            
          </tr>
        </table>        

    </div>

</div>
--- NEW FILE: exam_freetext.pt ---
 
<div metal:define-macro="view"
       tal:omit-tag="">

    <div>
                    
        <h2 tal:content="currentQuestion/title" />
        <bR />
        <b tal:content="structure python:currentQuestion.getQuestion()" />
        <br/>
        <span tal:content="python: currentQuestion.getInstruction()" />
        
        <br/><br/>

        <tal:define tal:define="responseObj python: context.deliverResponse(currentQuestion, create=False)">
            
            <textarea tal:attributes="name  python:currentQuestion.UID()"><tal tal:replace="python:responseObj[currentQuestion.UID()]"/></textarea>
                                   
        </tal:define>

    </div>

</div>





<div metal:define-macro="eval"
       tal:omit-tag="">

    <div>
                    
        <h2 tal:content="currentQuestion/title" />
        <bR />
        <span tal:content="structure python:currentQuestion.getQuestion()" />
      
        <br/><br>

        <tal tal:define="responseObj python: context.deliverResponse(currentQuestion, create=False)">


          <dt>user:</dt>
          <dd tal:content="python: responseObj[currentQuestion.UID()]" />

          <dt>example:</dt> 
          <dd tal:content="python: currentQuestion.getExemplar()" />

          <!--span tal:condition="python:len(currentQuestion.contentValues()) > 0">
                
          </span-->


        </tal>        

    </div>

</div>
--- NEW FILE: exam_math.pt ---
 
<div metal:define-macro="view"
       tal:omit-tag="">

    <div>
                    
        <h2 tal:content="currentQuestion/title" />
        <bR>
        <b tal:content="structure python:currentQuestion.getQuestion()" />
        <br/>
        <span tal:content="python: currentQuestion.getInstruction()" />
        
        <br/><br/>

        <tal:define tal:define="responseObj python: context.deliverResponse(currentQuestion, create=False)">
            <input type="text" 
                   tal:attributes="name  python:currentQuestion.UID();
                                   value python:responseObj[currentQuestion.UID()]">
        </tal:define>

    </div>

</div>



<div metal:define-macro="eval"
       tal:omit-tag="">

    <div>
                    
        <h2 tal:content="currentQuestion/title" />
        <bR />
        <span tal:content="structure python:currentQuestion.getQuestion()" />
      
        <br/><br/>

        <tal tal:define="responseObj python: context.deliverResponse(currentQuestion, create=False)">
        
        <table class="listing"
               summary="user result">

         <thead>
            <tr>
                <th i18n:translate="label_useranswer">user answer</th>
                <th i18n:translate="label_correctanswer">correct answer</th>
                <th i18n:translate="label_is_this_correct">correct?</th>
            </tr>
          </thead>

          <tr>
            <td>
                <input type="text" disabled="disabled"
                       tal:attributes="name  python:currentQuestion.UID();
                                       value python:responseObj[currentQuestion.UID()]">
            </td>
            <td> 
              <span tal:condition="python:currentQuestion.contentValues()"
                    tal:define="answer python:currentQuestion.contentValues()[0]">
    
                    <i tal:content="python: answer.getCorrect()" />
                  
              </span>
            </td>
            <td>
              <span tal:condition="python:currentQuestion.contentValues()"
                    tal:define="answer python:currentQuestion.contentValues()[0]">
    
                    <span tal:content="structure python: test(answer.processValue(responseObj[answer.UID()]), '<img src=right_answer.gif>', '<img src=wrong_answer.gif>')" />
              
              </span>
            </td>

          </tr>
        </table>


        </tal>        

    </div>

</div>
--- NEW FILE: exam_finished.pt ---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
      lang="en-US"
      metal:use-macro="here/main_template/macros/master"
      i18n:domain="eduplone">
  <body>

    <div metal:fill-slot="main"
         tal:define="portal_type python:here.getPortalTypeName().lower();
                     view_template python:'%s_view' % portal_type;
                     view_macros python:path('here/%s/macros|nothing' % view_template);
                     body_macro view_macros/body|nothing;
                     ">

        <div metal:define-macro="main"
             tal:omit-tag="">


            <div metal:define-macro="page_nav"
                tal:define="results python:here.objectValues();
                            Batch python:modules['Products.CMFPlone'].Batch;
                            b_size python:len(results);
                            b_size request/b_size | b_size;
                            b_start python:0;
                            b_start request/b_start | b_start;
                            batch python:Batch(results, b_size, int(b_start), orphan=0, pagerange=2);">
               
                <div metal:use-macro="here/batch_macros/macros/navigation" />

                
                                     
                    <tal:repeat tal:repeat="currentQuestion batch">

                        <fieldset tal:define="context python:here;
                                              pt_question python:currentQuestion.getQuestionType().lower().replace('question','');
                                              exam_eval_macro python: path('here/exam_%s/macros/eval' % pt_question)" >
            
                             <tal metal:use-macro="exam_eval_macro" />
            
                        </fieldset>
                    </tal:repeat>

                    <br/>
                    

                <div metal:use-macro="here/batch_macros/macros/navigation" />
                
            </div>

        </div>



    </div>

  </body>
</html>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.