Final Project: Requirements

Requirements

As usual we will read the RST file for their instruction. For simplicity, assume we have the following RST content:

.. code:: python

  # PROGRAMMING QUIZ

  import unittest2

  def say_hello(something):
    return something

  class ProgrammingQuiz(unittest2.TestCase):
    def test1(self):
      self.assertEqual('Hello world', say_hello('world'))

  # END OF PROGRAMMING QUIZ

When we intrepret the code directive, followed by # PROGRAMMING QUIZ comment, our application should be:

  1. Replace the whole code block as a ref, similar to what we did for hyperlink.
  2. We should also store everything found in this block into a CodeInput box such that it allows student to start editing the source code to complete the programming quiz.
  3. We should also provide buttons for students to (1) start over, (2) execute the code by running the unittest.main() and present the result, (3) go back to the page which triggers the programming test.
  4. We expect to have a seperate screen for programming quiz. You may check out this video on how to add another screen via Screen Manager in Kivy framework.
  5. We should have a way to (1) execute the program, (2) output of test cases, either passing or failing. For (1), we can look at this function. For (2) we can look at this article and this documentation.

Technical Requirements

  1. After you have implemented your change, if you copy your main.py into your mobile phone, you will found that the mobile app cannot be run. It is due to that CodeInput box requires Pygments for its syntax highlighting function, but Pygments is missing in Kivy launcher. To handle this, you may either (1), Fallback to Text Input (by adding a import fallback handler), (2) or add Pygments dependency and build via Buildozer as mentioned in the next page.
  2. (Optional) Ideally, we should provide a way to store and retrieve the programing quiz history such that students can track and revise later. Ideally, we should be able to leverage GitHub Gist for storage. This way, student and write their code on-the-go in cell phone, and carry on coding in front of desktop computer by checking out the Gist. Support of this feature is not hard but it involves a bit of integration effort. Cosider this as the final challenges :)

Starter Code / Test Cases

There is no starter code / start test cases for this time. You may refer to previous module on how to start :)