当前位置: 首页>>代码示例>>Python>>正文


Python common.getExportDocType函数代码示例

本文整理汇总了Python中exe.webui.common.getExportDocType函数的典型用法代码示例。如果您正苦于以下问题:Python getExportDocType函数的具体用法?Python getExportDocType怎么用?Python getExportDocType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getExportDocType函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, parent, idevice):
        """
        Pre-create our field ids
        """
        Block.__init__(self, parent, idevice)
        
       
        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.instructionsForLearners.idevice is None: 
            idevice.instructionsForLearners.idevice = idevice
        if idevice.content.idevice is None: 
            idevice.content.idevice = idevice
        if idevice.feedback.idevice is None: 
            idevice.feedback.idevice = idevice
            
        dT = common.getExportDocType()
        sectionTag = "div"
        if dT == "HTML5":
            sectionTag = "section"
            
        idevice.instructionsForLearners.htmlTag = sectionTag
        idevice.instructionsForLearners.class_ = "block instructions"
        idevice.feedback.htmlTag = sectionTag            

        self.instructionElement = TextAreaElement(idevice.instructionsForLearners)
        self.instructionElement.field.content_w_resourcePaths = c_(self.instructionElement.field.content_w_resourcePaths)
        self.listaElement = ListaElement(idevice.content)
        self.feedbackElement = \
            TextAreaElement(idevice.feedback)
        self.previewing        = False # In view or preview render
        if not hasattr(self.idevice,'undo'): 
            self.idevice.undo = True
开发者ID:UstadMobile,项目名称:exelearning-ustadmobile-work,代码行数:33,代码来源:listablock.py

示例2: getNavigationLink

    def getNavigationLink(self, prevPage, nextPage, pages):
        """
        return the next link url of this page
        """
        dT = common.getExportDocType()
        lb = "\n" #Line breaks
        navTag = "div"
        if dT == "HTML5":
            navTag = "nav"
        html = "<"+navTag+" class=\"pagination noprt\">"+lb
        ext = 'html'
        if G.application.config.cutFileName == '1':
            ext = 'htm'

        if prevPage:
            html += "<a href=\"" + quote(prevPage.name) + '.' + ext + "\" class=\"prev\"><span>"
            html += "<span>&laquo; </span>%s</span></a>" % c_('Previous')

        if self.node.package.get_addPagination():
            if prevPage:
                html += ' <span class="sep">| </span>'
            html += "<span class=\"page-counter\">" + c_('Page %s of %s') % ('<strong>'+str(pages.index(self) + 1)+'</strong>','<strong>'+str(len(pages))+'</strong>')+ "</span>"

        if nextPage:
            if self.node.package.get_addPagination() or prevPage:
                html += ' <span class="sep">| </span>'
            html += "<a href=\"" + quote(nextPage.name) + '.' + ext + "\" class=\"next\"><span>"
            html += "%s<span> &raquo;</span></span></a>" % c_('Next')

        html += lb + "</" + navTag + ">" + lb
        return html
开发者ID:exelearning,项目名称:iteexe,代码行数:31,代码来源:websitepage.py

示例3: renderView

 def renderView(self, preview=False):
     """
     Returns an XHTML string for viewing this element
     """
     lb = "\n" #Line breaks
     dT = common.getExportDocType()
     sectionTag = "div"
     titleTag1 = "h3"
     titleTag2 = "h4"
     if dT == "HTML5":
         sectionTag = "section"
         titleTag1 = "h1"
         titleTag2 = "h1"        
     html  = ''
     html += '<'+sectionTag+' class="question">'+lb
     html += '<'+titleTag1+' class="js-sr-av">' + c_("Question")+'</'+titleTag1+'>'+lb        
     if preview: 
         html += self.questionElement.renderPreview()
     else:
         html += self.questionElement.renderView()
     # Answers
     html += '<'+sectionTag+' class="iDevice_answers">'+lb
     html += '<'+titleTag2+' class="js-sr-av">' + c_("Answers")+'</'+titleTag2+'>'+lb        
     for element in self.options:
         if preview: 
             html += element.renderPreview()      
         else:
             html += element.renderView()      
     html += "</"+sectionTag+">"+lb
     
     html += "</"+sectionTag+">"+lb
     
     return html
开发者ID:Rafav,项目名称:iteexe,代码行数:33,代码来源:testquestionelement.py

示例4: renderFeedbackView

 def renderFeedbackView(self, is_preview=False):
     """
     return xhtml string for display this option's feedback
     """
     lb = "\n" #Line breaks
     dT = common.getExportDocType()
     sectionTag = "div"
     titleTag = "h4"
     if dT == "HTML5":
         sectionTag = "section"
         titleTag = "h1"     
     
     if is_preview:
         content = self.question_feedback.field.content_w_resourcePaths
     else:
         content = self.question_feedback.field.content_wo_resourcePaths        
     
     html = '<'+sectionTag+' id="s'+self.id+'" class="feedback js-feedback js-hidden">'+lb
     html += '<'+titleTag+' class="js-sr-av">'+c_("Feedback")+'</'+titleTag+'>'+lb
     if self.question.isCorrect:
         html += '<p><strong id="s'+self.id+'-result" class="right">'+c_("True")+'</strong></p>'+lb
     else:
         html += '<p><strong id="s'+self.id+'-result" class="wrong">'+c_("False")+'</strong></p>'+lb
     html += content+lb
     html += '</'+sectionTag+'>'+lb   
     
     return html
开发者ID:RichDijk,项目名称:eXe,代码行数:27,代码来源:truefalseelement.py

示例5: render

    def render(self, package, for_print=0):
        """
        Returns an XHTML string rendering this page.
        """
        dT = common.getExportDocType()
        lb = "\n" #Line breaks
        sectionTag = "div"
        headerTag = "div"
        if dT == "HTML5":
            sectionTag = "section"
            headerTag = "header"
            
        if package.title!='':
            title = escape(package.title)
        else:
            title = escape(package.root.titleLong)
        html  = self.renderHeader(title, for_print)
        if for_print:
            # include extra onload bit:
            html += u'<body class="exe-single-page" onload="print_page()">'
        else:
            html += u'<body class="exe-single-page">'
        html += u'<script type="text/javascript">document.body.className+=" js"</script>'+lb
        html += u"<div id=\"content\">"+lb
        html += u"<"+headerTag+" id=\"header\">"
        html += "<h1>"+escape(package.title)+"</h1>"
        html += u"</"+headerTag+">"+lb
        html += u"<"+sectionTag+" id=\"main\">"+lb
        html += self.renderNode(package.root, 1)
        html += u"<"+sectionTag+" id=\"lmsubmit\"></"+sectionTag+"><script type=\"text/javascript\" language=\"javascript\">doStart();</script>"
        html += u"</"+sectionTag+">"+lb
        html += self.renderLicense()+lb
        html += self.renderFooter()+lb
        html += u"</div>"+lb # Close content
        # Some styles might have their own JavaScript files (see their config.xml file)
        style = G.application.config.styleStore.getStyle(self.node.package.style)
        if style.hasValidConfig:
            html += style.get_extra_body()        
        html += u'</body>'
        html += u'<script type="text/javascript" src="lernmodule_net_custom.js"></script>'+lb
        html += u'</html>'
        
        # JR: Eliminamos los atributos de las ecuaciones
        aux = re.compile("exe_math_latex=\"[^\"]*\"")
        html = aux.sub("", html)
        aux = re.compile("exe_math_size=\"[^\"]*\"")
        html = aux.sub("", html)
        #JR: Cambio la ruta de los enlaces del glosario y el &
        html = html.replace("../../../../../mod/glossary", "../../../../mod/glossary")
        html = html.replace("&concept", "&amp;concept")
        # Remove "resources/" from data="resources/ and the url param
        html = html.replace("video/quicktime\" data=\"resources/", "video/quicktime\" data=\"")
        html = html.replace("application/x-mplayer2\" data=\"resources/", "application/x-mplayer2\" data=\"")
        html = html.replace("audio/x-pn-realaudio-plugin\" data=\"resources/", "audio/x-pn-realaudio-plugin\" data=\"")
        html = html.replace("<param name=\"url\" value=\"resources/", "<param name=\"url\" value=\"")

        return html
开发者ID:tquilian,项目名称:exelearningTest,代码行数:57,代码来源:singlepage.py

示例6: genItemResStr

    def genItemResStr(self, page):
        """
        Returning xml string for items and resources
        """
        itemId = "ITEM-" + unicode(self.idGenerator.generate())
        resId = "RES-" + unicode(self.idGenerator.generate())
        filename = page.name + ".html"

        self.itemStr += '<item identifier="' + itemId + '" isvisible="true" '
        self.itemStr += 'identifierref="' + resId + '">\n'
        self.itemStr += "    <title>"
        self.itemStr += escape(page.node.titleShort)
        self.itemStr += "</title>\n"

        self.resStr += '<resource identifier="' + resId + '" '
        self.resStr += 'type="webcontent" '

        self.resStr += 'href="' + filename + '"> \n'
        self.resStr += (
            """\
    <file href="%s"/>
    <file href="base.css"/>
    <file href="content.css"/>"""
            % filename
        )
        self.resStr += "\n"
        fileStr = ""

        dT = common.getExportDocType()
        if dT == "HTML5" or common.nodeHasMediaelement(page.node):
            self.resStr += '    <file href="exe_html5.js"/>\n'

        resources = page.node.getResources()
        my_style = G.application.config.styleStore.getStyle(page.node.package.style)
        if common.nodeHasMediaelement(page.node):
            resources = resources + [f.basename() for f in (self.config.webDir / "scripts" / "mediaelement").files()]
        if common.hasGalleryIdevice(page.node):
            self.resStr += '    <file href="exe_lightbox.js"/>\n'
            self.resStr += '    <file href="exe_lightbox.css"/>\n'
            self.resStr += '    <file href="exe_lightbox_close.png"/>\n'
            self.resStr += '    <file href="exe_lightbox_loading.gif"/>\n'
            self.resStr += '    <file href="exe_lightbox_next.png"/>\n'
            self.resStr += '    <file href="exe_lightbox_prev.png"/>\n'
        if my_style.hasValidConfig:
            if my_style.get_jquery() == True:
                self.resStr += '    <file href="exe_jquery.js"/>\n'
        else:
            self.resStr += '    <file href="exe_jquery.js"/>\n'

        for resource in resources:
            fileStr += '    <file href="' + escape(resource) + '"/>\n'

        self.resStr += fileStr
        self.resStr += "</resource>\n"
开发者ID:RichDijk,项目名称:eXe,代码行数:54,代码来源:imsexport.py

示例7: renderFooter

    def renderFooter(self):
        """
        Returns an XHTML string rendering the footer.
        """
        dT = common.getExportDocType()
        footerTag = "div"
        if dT == "HTML5":
            footerTag = "footer"

        html = ""
        if self.node.package.footer != "":
            html += '<' + footerTag + ' id="siteFooter">'
            html += self.node.package.footer + "</" + footerTag + ">"

        return html
开发者ID:UstadMobile,项目名称:exelearning-ustadmobile-work,代码行数:15,代码来源:pages.py

示例8: renderViewContent

 def renderViewContent(self):
     """
     Returns an XHTML string for previewing this block
     """
     lb = "\n" #Line breaks
     dT = common.getExportDocType()   
     if dT == "HTML5":
         html = '<div class="iDevice_content" style="width:100%">'+lb
         if self.idevice.url:
             html += '<iframe src="'+self.idevice.url+'" width="600" height="'+self.idevice.height+'" style="width:100%"></iframe>'+lb
     else:        
         html = '<div class="iDevice_content">'+lb
         if self.idevice.url:
             html += '<iframe src="'+self.idevice.url+'" width="100%" height="'+self.idevice.height+'px"></iframe>'+lb
     html += '</div>'+lb
     return html
开发者ID:Rafav,项目名称:iteexe,代码行数:16,代码来源:externalurlblock.py

示例9: renderQuestion

    def renderQuestion(self, is_preview):
        """
        Returns an XHTML string for viewing and previewing this question element
        """
        log.debug("renderPreview called in the form of renderQuestion")
        
        lb = "\n" #Line breaks
        dT = common.getExportDocType()
        titleTag = "h3"
        if dT == "HTML5":
            titleTag = "h1"
        
        if is_preview:
            html = '<'+titleTag+' class="js-sr-av">' + c_("Question")+' '+str(self.index+1)+'</'+titleTag+'>'+lb
            html += self.question_question.renderPreview()
            if self.question_hint.field.content:
                html += common.ideviceHint(self.question_hint.field.content,"preview","h4")
        else: 
            html = '<form name="true-false-form-'+self.id+'" action="#" class="activity-form">'+lb        
            html += '<'+titleTag+' class="js-sr-av">' + c_("Question")+' '+str(self.index+1)+'</'+titleTag+'>'+lb
            html += self.question_question.renderView()
            if self.question_hint.field.content:
                html += common.ideviceHint(self.question_hint.field.content,"view","h4")



        html += "<fieldset data-role='controlgroup' data-type='horizontal' >"+lb
        html += '<p class="iDevice_answer js-required">'+lb
        html += '<label for="true'+self.id+'">'
        html += self.__option(0, 2, "true")+' '
        html += c_("True")
        html += '</label> '+lb
        html += '<label for="false'+self.id+'">'
        html += self.__option(1, 2, "false")+' '
        html += c_("False")
        html += '</label>'+lb
        html += '</p>'+lb
        html += "</fieldset>"+lb
        
        if not is_preview:
            html += '</form>'+lb
       
        return html
开发者ID:UstadMobile,项目名称:exelearning-ustadmobile-work,代码行数:43,代码来源:truefalseelement.py

示例10: renderView

    def renderView(self, style):
        """
        Returns an XHTML string for viewing this block
        """     

        lb = "\n" #Line breaks
        dT = common.getExportDocType()
        figureTag = "div"
        if dT == "HTML5":
            figureTag = "figure"        
        
        html = common.ideviceHeader(self, style, "view")
        
        html += '<div class="iDevice_content">'+lb
        html += '<'+figureTag+' class="image_text" style="width:'+str(self.idevice.imageMagnifier.width)+'px;float:'+self.idevice.float+';'
        if self.idevice.float == 'left':
            html += 'margin:0 20px 20px 0'
        if self.idevice.float == 'right':
            html += 'margin:0 0 20px 20px'
        html += '">'  
        html += lb
        html += self.imageMagnifierElement.renderView()
        if self.idevice.caption != '':
            html = html.replace(' alt="" ',' alt="'+self.idevice.caption.replace('"','&quot;')+'" ', 1)
            if dT == "HTML5":
                html += '<figcaption style="font-weight:bold">'+self.idevice.caption+'</figcaption>'+lb
            else:
                html += '<strong>'+self.idevice.caption+'</strong>'+lb
        html += '</'+figureTag+'>'+lb 
        text = self.textElement.renderView()
        if text:
            text = text.replace('"block iDevice_content"', '"iDevice_text"', 1)
            html += text
        else:
            html += '&nbsp;'
        html += '</div>'+lb # /.iDevice_content
        
        html += common.ideviceFooter(self, style, "view")

        return html
开发者ID:Rafav,项目名称:iteexe,代码行数:40,代码来源:imagemagnifierblock.py

示例11: __init__

    def __init__(self, index, idevice, question):
        """
        Initialize
        'index' is our number in the list of questions
        'idevice' is a case study idevice
        'question' is a exe.engine.casestudyidevice.Question instance
        """
        self.index        = index
        self.id           = "q" + unicode(index) + "b" + idevice.id        
        self.idevice      = idevice


        self.quesId       = "quesQuestion" + unicode(index) + "b" + idevice.id
        self.feedbackId   = "quesFeedback" + unicode(index) + "b" + idevice.id

        self.question     = question
        # also split out each part for a separate TextAreaElement:

        # but first....  
        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set: 
        if question.questionTextArea.idevice is None: 
            question.questionTextArea.idevice = idevice 
        if question.feedbackTextArea.idevice is None: 
            question.feedbackTextArea.idevice = idevice
            
        dT = common.getExportDocType()
        sectionTag = "div"
        if dT == "HTML5":
            sectionTag = "section" 
        question.questionTextArea.htmlTag = sectionTag

        self.question_question = TextAreaElement(question.questionTextArea)
        self.question_question.id = self.quesId 
        
        question.feedbackTextArea.htmlTag = "div"
        
        self.question_feedback = TextAreaElement(question.feedbackTextArea)
        self.question_feedback.id = self.feedbackId 
开发者ID:RichDijk,项目名称:eXe,代码行数:39,代码来源:questionelement.py

示例12: renderView

    def renderView(self, style):
        """
        Returns an XHTML string for viewing this block
        """
        lb = "\n" #Line breaks
        dT = common.getExportDocType()
        sectionTag = "div"
        if dT == "HTML5":
            sectionTag = "section"
            
        html = common.ideviceHeader(self, style, "view")
        html += self.instructionElement.renderView()
        
        for element in self.questionElements:
            html += "<"+sectionTag+" class=\"question\">"+lb
            html += element.renderQuestionView()
            html += element.renderFeedbackView()
            html += "</"+sectionTag+">"+lb
            
        html += common.ideviceFooter(self, style, "view")

        return html
开发者ID:Rafav,项目名称:iteexe,代码行数:22,代码来源:truefalseblock.py

示例13: getNavigationLink

    def getNavigationLink(self, prevPage, nextPage):
        """
        return the next link url of this page
        """
        dT = common.getExportDocType()
        lb = "\n" #Line breaks
        navTag = "div"
        if dT == "HTML5":
            navTag = "nav"
        html = "<"+navTag+" class=\"pagination noprt\">"+lb

        if prevPage:
            html += "<a href=\""+quote(prevPage.name)+".html\" class=\"prev\">"
            html += "<span>&laquo; </span>%s</a>" % c_('Previous')

        if nextPage:
            if prevPage:
                html += " | "
            html += "<a href=\""+quote(nextPage.name)+".html\" class=\"next\">"
            html += " %s<span> &raquo;</span></a>" % c_('Next')
            
        html += lb+"</"+navTag+">"+lb
        return html
开发者ID:kohnle-lernmodule,项目名称:KITexe201based,代码行数:23,代码来源:websitepage.py

示例14: getNavigationLink

    def getNavigationLink(self, prevPage, nextPage):
        """
        return the next link url of this page
        """
        dT = common.getExportDocType()
        lb = "\n"  # Line breaks
        navTag = "div"
        if dT == "HTML5":
            navTag = "nav"
        html = "<" + navTag + ' class="pagination noprt">' + lb

        if prevPage:
            html += '<a href="' + quote(prevPage.name) + '.html" class="prev">'
            html += "<span>&laquo; </span>%s</a>" % c_("Previous")

        if nextPage:
            if prevPage:
                html += " | "
            html += '<a href="' + quote(nextPage.name) + '.html" class="next">'
            html += " %s<span> &raquo;</span></a>" % c_("Next")

        html += lb + "</" + navTag + ">" + lb
        return html
开发者ID:kohnle-lernmodule,项目名称:exe201based,代码行数:23,代码来源:websitepage.py

示例15: renderView

 def renderView(self, preview=False):
     """
     Returns an XHTML string for viewing this option element
     """
     log.debug("renderView called")
     
     lb = "\n" #Line breaks
     dT = common.getExportDocType()
     sectionTag = "div"
     if dT == "HTML5":
         sectionTag = "section"
     
     html = '<'+sectionTag+' class="iDevice_answer">'+lb
     
     # Checkbox
     fieldId = self.keyId+unicode((self.index+1));
     html += '<p class="iDevice_answer-field js-required">'+lb
     html += '<label for="'+fieldId+'" class="sr-av"><a href="#answer-'+fieldId+'">' + c_("Option")+' '+unicode((self.index+1))+'</a></label>'
     html += '<input type="radio" name="'+self.keyId+'" id="'+fieldId+'" value="'+unicode(self.index)+'" />'
     html += lb
     html += '</p>'+lb       
     
     # Answer content
     html += '<div class="iDevice_answer-content" id="answer-'+fieldId+'">'
     if dT != "HTML5":
         html += '<a name="answer-'+fieldId+'"></a>'
     html += lb
     if preview: 
         html += self.answerElement.renderPreview()
     else:
         html += self.answerElement.renderView()
     html += '</div>'+lb
     
     html += "</"+sectionTag+">"+lb
    
     return html    
开发者ID:Rafav,项目名称:iteexe,代码行数:36,代码来源:testoptionelement.py


注:本文中的exe.webui.common.getExportDocType函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。