Giter Site home page Giter Site logo

ok-client's People

Contributors

akshitdewan avatar albert12132 avatar alejandrogarciasalas avatar alvinwan avatar antaresc avatar brianhou avatar c-w avatar colinschoen avatar dependabot[bot] avatar epai avatar haydensheung1 avatar hsheung avatar itsvs avatar ja5087 avatar jathak avatar kavigupta avatar kevinlin1 avatar khalilsarwari avatar knrafto avatar kvchen avatar larynqi avatar mehrdadn avatar pamelafox avatar papajohn avatar qiaojianjack avatar rahularya50 avatar soumyabasu avatar spnchian avatar sumukh avatar tommy11jo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ok-client's Issues

Show students what email they've submitted under & change wording for auth

I've seen a lot of students type in their ID Number instead of their CalNet username. Can we change the input prompt to ask for CalNet Username:?

In addition, after submitting - it would be good for students to see what account it's submitted under. Something like

Submission for [email protected] successful 
URL:  http://ok-server.appspot.com/#2323232/submission/123123

If the client doesn't easily have access to this information, we could also send the information down from the server.

Prompt users to authenticate with full berkeley email address

Current authentication looks like this:

Performing authentication
Please enter your CalNet ID.
CalNet ID: example.id

The term "CalNet ID" has been confusing to students in the past, with some students interpreting it to mean their student ID. The prompt should explicitly ask for their Bearfacts email:

Performing authentication
Please enter your Bearfacts email (@berkeley.edu)
Email: [email protected]

Dump tests only if they've been changed

The best way to do this is to add a modified property method in the Serializable class. Simply having setattr toggle an attribute is probably not enough; consider creating a "snapshot" of the initialization and comparing when dumping tests.

Error when running python ok

There's an error when a student runs "py ok". They get this stacktrace. They can't submit either.

Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in run_module_as_main
"main", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "ok__main
.py", line 9, in
File "ok\client\cli\ok.py", line 122, in main
File "ok\client\cli\common\assignment.py", line 20, in load_config
File "ok\client\sources\common\core.py", line 174, in call
File "ok\client\cli\common\assignment.py", line 51, in post_instantiation
File "ok\client\cli\common\assignment.py", line 86, in load_tests
File "ok\client\sources\doctest__init
_.py", line 48, in load
File "ok\client\sources\common\core.py", line 164, in call
File "ok\client\sources\common\core.py", line 186, in setattr
File "ok\client\sources\common\core.py", line 45, in coerce
TypeError

Add more test coverage

Sources and protocols have pretty decent test coverage, but the following modules still need unittests:

  • cli/common/assignment.py
  • sources/doctest/load_test.py
  • sources/ok_test/load_test.py
  • utils/network.py

In addition, some integration tests are needed.

Do we need both protocol.on_start and protocol.on_interact now?

I recall that the original intention of having on_start is to send some info to the server before running on_interact. Now that protocol.on_start and protocol.on_interact are simply run sequentially, one after the other, are the two still necessary? I should note that no protocol currently implements both on_start and on_interact.

Rewrite AnalyticsProtocol

  • Record all command line arguments
  • Rename to InfoProtocol, since analytics occurs throughout OK, not just in this protocol.

Auth errors with multiple instances of ok

Since we use a single port number (7777), authentication will always error when students have multiple instances of ok running. This might happen when, say, auth is taking too long, so a student opens up a new tab and auths again.

Now, my question is that is this desirable, or should we allow one of the authentications to succeed? (by using a random port number). Also, if students happen to have another service running on 7777, then ok won't interfere, but I think this is much less likely.

Integrate ucb.py with ok

The biggest issue with integration is usage. Ideally, the __init__.py file in OK can define an interface of features (like the main decorator, interact, and trace). However, Python doesn't support direct imports from ZIP-archives (which is what OK is currently distributed as). For example, the following does not work:

from ok import main, interact, trace

The "easiest" way to work is to add ok to sys.path:

import sys
sys.path.insert(0, 'ok')
from ok import main, interact, trace

However, that solution is rather clunky. Thoughts on how to get around this?

ok should list all valid tests, perhaps when edit distance is too large

I think we should be more clear what problems ok is able to test. Using Homework 1 as an example, it is not clear that there are no tests for if_function.

Interestingly, running python3 ok -q if_function actually runs the tests for hailstone. I do think that running python3 ok -q hailston and running hailstone is nice, so maybe we should introduce some maximum edit distance we are willing to run a test for. Typing the entire function name out (as opposed to q1) is a bit inconvenient though, so I think somehow mapping q1 to a list of functions to run doctests for would be preferable.

Add Behavioral tests to ok

We should have some kind of visual testing for client-side issues so that any future rewrite doesn't break things. In particular, the SyntaxError wasn't being handled properly until v1.3.3.

Restoring from a backup

Once I've finished #77, I'd like to add a --restore option that would allow students to retrieve a previous version of their assignment that's been backed up to the server. This could be particularly useful for partners on an assignment to share their work with each other.

I should be able to write this, but I'm not sure how I should handle overwriting existing files on the student's computer when replacing them with the backup. Here are the three ways I was thinking of handling this:

Option A: Warn the student that restoring to an older backup will overwrite the files currently on their computer and have them confirm that they want to do this.

Option B: Move the current version of any files that will be replaced into a subdirectory before replacing them.

Option C: Make a new server-side backup before restoring an old backup. This would probably be the most seamless option for students, but it would complicate assignment configurations by requiring that the restore protocol is listed after the backup protocol.

Let me know which if these options you think would work best or if you have some other idea.

Missing src file doesn't fail.

When running python3 ok without hw01.py in the same directory, we should print some error message and exit. This currently produces no output, which could be confused with all tests passing.

Submit + Update should provide explanation for why the submission failed.

Currently, if the client discovers it needs to update - the submission will fail - attempting to submit a few times before giving up. The submission will succeed on the second try. We should print should a different error message to make this clearer. (Something along the lines of 'ok had to update, please try submitting again')

Backing up your work...
Submitting project... 0% complete
Submitting project... 0% complete
Submitting project... 0% complete
Submitting project... 0% complete
Submitting project... 0% complete
Submission failed. Please check your network connection and try again

Rename config.json

We should rename config.json to be more assignment related. I'm not 100% sure how this'll work, but maybe it can look for all *.json files and then just use the first one that it can parse successfully (and if nothing parses, we can say "no config found").

The reason for this is that it becomes really obvious what ok uses to figure out the assignment- just have "*.json" in there and it'll work.

Client side confirmation of submission after deadline

Have we thought of adding a warn_date to the assignments .ok file - and if the current time it confirms before sending in a submission? (Similar to glookup's late submission)

A related issue is actually displaying helpful error messages. The server currently can send helpful error messages. Displaying more than just the "Check your network connectivity" that is displayed now on errors would make things clear for students.

Confusing tracebacks

SyntaxErrors (like IndentationErrors) aren't caught and produce an ugly traceback. For example, if hw01.py contains print 1, then the traceback below is produced:

$ python3 ok
=====================================================================
Assignment: Homework 1
OK, version v1.3.2
=====================================================================

Traceback (most recent call last):
  File "/usr/lib/python3.3/runpy.py", line 160, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python3.3/runpy.py", line 73, in _run_code
    exec(code, run_globals)
  File "ok/__main__.py", line 9, in <module>
  File "ok/client/cli/ok.py", line 125, in main
  File "ok/client/cli/common/assignment.py", line 21, in load_config
  File "ok/client/sources/common/core.py", line 174, in __call__
  File "ok/client/cli/common/assignment.py", line 52, in post_instantiation
  File "ok/client/cli/common/assignment.py", line 82, in _load_tests
  File "ok/client/sources/doctest/__init__.py", line 23, in load
  File "ok/client/sources/common/importing.py", line 6, in load_module
  File "/usr/lib/python3.3/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 853, in _load_module
  File "<frozen importlib._bootstrap>", line 980, in get_code
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "./hw01.py", line 35
    print 1
          ^
SyntaxError: invalid syntax

Incorrect URL displayed after submission

When I submitted lab 2, the URL displayed in the client (after submission finished) did not contain any file contents.

I believe the client submits multiple times, and it should only show the URL for the submission that actually includes the contents of the files.

Add scheme support

In order to get Scheme support working before the end of March, we need to do the following:

  • Add an OkTest suite that supports Scheme tests. OK should hook into a "scheme" or "scheme.py" Python-executable script (most likely situated in the current directory. See 61A's Scheme project for an interface
  • Write up a test format for Scheme tests.
  • Specific to 61A's Scheme homework assignments: generate *.pyc versions of 61A's completed Scheme project. This won't actually be part of the OK client, but we'll use it for testing.

How can students add tests?

We should have some standard way for students to write their own tests. One obvious option is to have them add a new function in their source file that has doctests, and make an option for ok to run those doctests (even if they aren't specified in the .ok file).

--submit cannot connect to internet

Here's what I get when I try to run python3 ok --submit
Backing up your work...
Submitting project... 0% complete
Submitting project... 0% complete
Submitting project... 0% complete
Submitting project... 0% complete
Submitting project... 0% complete
Submission failed. Please check your network connection and try again

However, I can still browse other web pages from my computer. All other ok commands seem to work as well (I was able to authenticate).

My computer runs on OSX Yosemite.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.