def get_page(self, submission_url=None):
     """
     @param submission_url: the submission url where the service may return submissions
     @return: an ExercisePage object created from data retrieved from exercise service 
     """
     page            = ExercisePage(self)
     page.content    = self.exercise_page_content
     return page
コード例 #2
0
 def get_page(self, submission_url=None):
     """
     @param submission_url: the submission url where the service may return submissions
     @return: an ExercisePage object created from data retrieved from exercise service 
     """
     page = ExercisePage(self)
     page.content = self.exercise_page_content
     return page
    def get_page(self, submission_url=None):
        """
        @param submission_url: the submission url where the service may return submissions
        @return: an ExercisePage containing the exercise instructions and possibly a submit form 
        """
        page            = ExercisePage(self)
        page.content    = self.instructions

        # Adds the submission form to the content if there are files to be submitted.
        # A template is used to avoid hard-coded HTML here.
        if self.get_files_to_submit():
            template = loader.get_template('exercise/_file_submit_form.html')
            context = Context({'files' : self.get_files_to_submit()})
            page.content += template.render(context)

        return page
 def submit(self, submission):
     page            = ExercisePage(self)
     page.content    = self.submission_page_content
     page.is_accepted= True
     return page
コード例 #5
0
 def submit(self, submission):
     page = ExercisePage(self)
     page.content = self.submission_page_content
     page.is_accepted = True
     return page