Code Monkey home page Code Monkey logo

paperless's Introduction

Paperless

This is the paperless project for the cs198 program at Stanford. The goal is to create a web interface to make code commenting easy, and to avoid paper submission copies.

Paperless has been used by CS106A, CS106B, CS106X, CS106L, CS109L, and CS143 at Stanford.

============================================================

How to Get Involved

We'd love to have you contribute to paperless, and we are running it as an open source project.

  1. Tell us you want to get involved, and set up paperless locally and well send you a testing db. Email [email protected]

  2. Join the project management site Trello, and we'll add you to our board.

https://trello.com/board/paperless/4e71a616f8fe40db50566e3a

-- Assign yourself to any of the items there, or create a new one and move the card to the "Doing" list.

  1. Fork off your own version of Paperless

Quick explanation on forking: http://help.github.com/fork-a-repo/

  1. Make your awesome improvements

-- Note: If you are making what you think is a decent sized change, you should create a new branch for your feature. Here's some info on branching: http://learn.github.com/p/branching.html

  1. Submit a pull request, and well bring your changes into the main branch.

Quick reference on pull requests: http://help.github.com/send-pull-requests/

============================================================

Project Management and Issue Tracker

We do the project organization on Trello, the coolest site ever.

https://trello.com/board/paperless/4e71a616f8fe40db50566e3a

Local Configuration Info

Configure the Database

  • Download MAMP. (or WAMP or LAMP depending on OS)
  • Visit localhost:8888/MAMP
  • Click phpMyAdmin
  • Create a new database called 'paperless'
  • Get the sql copy of the database with relevant tables
  • Click import and select the sql file

Configure the Code

$ cd /Applications/MAMP/htdocs
$ git clone git://github.com/jkeesh/paperless.git
$ cd paperless
$ ./setup

Configure the Submissions

Download a few submissions folders for testing.

If you are going to work with local submissions files for testing, make sure you put them in a directory called submission_files

For example, for me it should look like this: submission_files/cs106a/submissions/jkeeshin/(assn)/(student)/(code)

Run

Visit localhost:8888/paperless

More Detailed

To work on both the local and live server, the config file is not tracked by the git repository. However, there are two files called config_local.php and config_web.php which show the contents of the configuration files for the web and your local machine. To get it to run locally copy the config_local.php file into a file called config.php.

cp config_local.php config.php

There are two .htaccess files, one for local and one for web.

cp .htaccess_local .htaccess 

to use the local version of the .htaccess file.

That is all that is in setup.

paperless's People

Contributors

achur avatar fyhuang avatar jjfeng avatar jkeesh avatar pcostell avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paperless's Issues

Database Utility Functions

It seems like we should make a class that has several database utility functions that we can use. What is the best way to structure this? Should it be just a separate class called Utility?

Here are some functions I think we need:

isSectionLeader
isStudent
getDisplayName

Do you think there are any others that would be useful?

User Type Edge Case

brought up by matt:

case 1: section leader --> sl view
case 2: student --> student view
edge case: student and sl --> option to choose which view for and which class?

Unify addCommentBox and editComment

similar code .. maybe we can rewrite this so that there is some general createDialog method created that takes a parameter for the starting text.

assignments file listing csv is in my WWW directory

i was having weird issues reading it. this could have been related to some other issue yesterday. lets find a better place to put that file.

and also we need to choose the correct file based on who the user is and what class it is

different comment view for students

edit the files so students do not have the ability to add/remove/modify comments. this should take the form of some parameter to the code file object (probably) of whether or not you can modify.

Correct Access Based on User Type

If the user is a section leader they should have a different view and different permissions than a student. If you are a section leader you should see code for students in your section, and if you are a student, you should only see your own files.

Ctrl+z multiple times should not bring up null dialog

If you press ctrl+z multiple times then after the first time it brings up a dialog box with null in it. Either it should only allow you to do ctrl+z once, or there should be a stack or list of recent comments which you can undo.

fix keyboard shortcuts

a few bugs in keybaord shortcuts with new comment view. in comments that have been loaded from the database, clicking them, and then tab does not submit. there may be others as well. should be small things to fix.

How will we associate a file path with a graded assignment?

It seems like it's going to be pretty difficult to accurately associate a directory path with a GradedAssignment row in the table. First, it's possible that a submitted assignment may have no entry in the Assignments table (for example 106b's assignment 3 warm up). Second, the assignment directory names are different than found in the database which, at first, seems possible to solve just by some string matching, but then it is complicated by the first difference since how do you if the assignment just isn't in the Assignments table? Third, the classes use inconsistent naming patterns for the path:
CS106A: /(sl_sunetid)/(assignment_name_camel_case)/(student_sunetid)_(num_of_submission)
CS106B: /(sl_sunetid)/(assignment_name_dashes)/(student_full_name) - (num_of_submission)
CS106X: /(sl_sunetid)/(assignment_name_underscores)/(student_full_name) - (num_of_submission)
Fourth, there can be multiple submission directories.

It seems difficult to solve this issue since submissions take very different forms. For example, 106a uses the built in eclipse submission mechanism and 106b/x have students upload their assignments directly to the submissions directory using fetch. And I think that some quarters professors use submit scripts.

A couple of possible solutions:

  1. Attempt to get all of the classes to standardize a path format.

  2. Do our best to match the path and then allow the section leader to select the appropriate information if we cannot match the directory name to the name in the Assignments table.

Other thoughts??

Highlight then exit

If you highlight an area, then X out -- i.e., an empty comment, it should unhighlight

Reorganize URL order

Right now if we have a link to a code file , it is

http://localhost:8888/paperless/code/STUDENT/ASSIGNMENT

which is ok. but now that STUDENT is always the suid, i think it makes more sense to reorder the URLS to mimic the directory structure which is submissions/sl/ASSIGNMENT/STUDENT

although this reordering doesnt change the functionality at all, i think it just makes sense in working with it. then when we list assignments for a student we just match either suid, or name which is now all in a variable called $students. One issue with display name is it is

First Last (suid) , not as you would expect
First Last

class config file

here is an idea:

so we have configuration details in config.php ... but there have to be a few different values for each class. currently , the assignemnt list, right now java or cpp files are hard coded in.

what we can do is create some sort of class configuration files
maybe which lists certain things in a csv format:
assignment list,
dummydir, file types accepted
show submit or not ... basically all of the things we are hard coding in we can take from a class configuration file

UPDATE:
Proposal for config file structure
admin list (not necessary, but then we can maintain the permissions structure and allow for other admins)
list of file types accepted
show submit (1 or 0)
list of assignment entries
dirName, Full Name, Due date

eg for 106x
majj, etc..
cpp, h
1
life,Assignment 1: Life,2011-01-14 15:15:00
simpleADTs,Assignment 2: Simple ADTs,2011-01-24 15:15:00
boggle,Assignment 3: Boggle,2011-02-02 15:15:00
sortingLab,Assignment 4: Sorting Lab,2011-02-14 15:15:00
pqueue,Assignment 5: PQueue,2011-02-23 15:15:00
pathfinder,Assignment 6: Pathfinder,2011-03-04 15:15:00

separate USERNAME from SECTION_LEADER

right now our main global is USERNAME, but that really doesnt make sense, because we look in the USERNAME directory for submissions. this works if USERNAME is a sl, but most of the users will be students. so we need to separate USERNAME from SECTION_LEADER, and get our globals to work for all users.

How to handle relations between database objects?

I'm somewhat unsure how to store the objects with relationships in the models. So for example, an AssignmentFile has many AssignmentComments so it is natural for the AssignmentFile class to have an array of AssignmentComment objects. Should these be loaded when the AssignmentFile object is loaded? Or should they only be loaded when requested?

classes that dont have section leaders

if we are going to make this work for 109L, we need to handle the case where there are no section leaders. maybe this was a bad choice in url structuring (i still support the choice of sls in url because thats what we designed it for), but i think a solution brought up by matt is that if there is no sl then assign the lecturer as the section leader. this must be done in the model class under getSectionLeaderForStudent. however, i'm not quite sure how to test that yet...?

any ideas? this is something we should try and fix now. basically i think we need to fix everything we can now thats not permissions configuration so that when the quarter starts its the only thing we have to do.

graded assignments?

not really sure what is going on with these, but with new 106bx submissions in the correct format, graded assignments are not found. why do we need these again? it has no connection to the rest of the code ... ? or does it?

any other bugs or comments?

i think we are nearing the end of a v1 run for this project. are there any other known bugs that we have? we may find more when the quarter starts, but it basically seems complete to me!

Issues with current_dialog

Certain ways of clicking put old text in the comment -- issue with current dialog. make sure curernt_dialog is always set correctly

How to write 'edit comment'

It seems like you could do edit comment where you just update the old comment in the database, or you could do it where when they click edit, you remove the old one right away and then resubmit a new one.

Is one of these methods preferred?

Tab Button Doesn't Work on Chrome

The Tab button successfully submits the comment on Firefox, but on Chrome it doesn't seem seem to work. A common thing I've found in Chrome is that it seems to register a bunch of key events (ten-ish) for what seems like only one key event. That is why I made those weird timer things on the key events.

add classname to url structure?

right now we have the classname as a hard coded variable, or something we can get from the database ... but does it make sense to have it in the url?

this could help on permissions.

is this unnecessary?

so code is at

/paperless/code/cs106a/breakout/student

Create Function Wrapper For Timer Safe Keyboard Events

Right now the ctrl+1 and ctrl+2 shortcuts use the same redundant timer code to make sure multiple key events aren't registered within some buffer of milliseconds. We should make a function that handles this functionality so all the keyboard shortcuts can be chrome-safe.

adding a comment to the wrong file

if a student has multiple files and you add a comment to the non-0th file, the comment will add, but display on the 0th file. bug!!

UPDATE:
Bug is that the comment adding does not work only when you hit tab. Should be an easy bug to fix

redesign

eric has some really nice mockups for a design of the site. this should be something we do, but probably the last thing we do

create links at top 'View Section' or 'View My Code'

this can handle several cases:

this way if you are a SL , you get a view section link which just takes you home
if you area student, you get a view my code link which takes you home

if you are a sl and student, you get both links. view my section takes you to your section, and view my code shows your code.

multiple submissions

should we allow students to see all their submissions ? i.e, if theyve submitted 10 breakouts show

breakout (1) (2) ... (10)

where the actual word 'breakout' links to brekaout 10?

-this may be unnecessary

permissions.php

I think we should create a file permissions.php which is included in all of the views
student, assignment, code, (and section leader aka main)

Here is the function it should have:
hasPermissionsForSection(class, sl)
hasPermissionForClass(class)
hasPermission(class,student)
// if USERNAME has permission to see 'student' in 'class'

this will check against some set constant or array to see if they have permission
if user is a student, he can see his own info
if user is a sl, he can see it if he is a sl for that class
if user is a coordinator/prof he can see it

other things to consider?

permissions for section leaders to view code

so this is a good idea, because then it handles the case where a section leader wants to grade/comment on a students assignment.

there is one important edge case to this edge case however!

what if i am a sl for 106a, so i have code viewing permissions, but i am a student in 106L. well then if i can see all the code, i can see the code for 106L, which i should not be able to see. so if you are a SL you should get viewing and commenting permissions on all code that you are a SL for

initial url routing

because of the toro handler, im not sure how to implement php redirects because it seems like some header information is already sent out.

Question 1) How to implement php redirects with Toro in index.php?

right now there is a javascript redirect that sends students who log in at /paperless to
/paperless/class/student/suid

I'm think it makes sense to send section leaders to a url called
/paperless/class/sectionleader/suidofsl (which now, actaully has the same functionality as the main.php url)

I think this would be good because then if you are a user who has multiple positions, we just give you correct access to the urls
/class1/sl/suid and /class2/student/suid

Backlinks from code pages to student pages

if a student jeremy submits five breakouts, his assignment will be breakout_5

then the link is /sl/breakout/jeremy_5

but then what that means is student=jeremy_5
so backlinks link to /student/jeremy_5 ... ive handled this in code.php, but maybe it should be handled somewhere else to stop those kind of links

utility function: getClass

we need a function in the model class getClass

getClass('jkeeshin') -> 106a, if im a sl for 106a
getClass('student') -> class

or it could alternatively return an array of classes for the case where
getClass('student') -> arr('106a', '106l') -> for sls in 106l. this is really not a crucial case, but we can think about it

issue with comments

comments break on re rendering because of newlines. i guess we should turn new lines into line breaks or something

Get Current User SUID

Figure out how to get the current users suid from webauth. we may need more permissions to do this? .. because the cookie info seems to be different based on the browser.

put sectionleader in assignment url

USERNAME is hardcoded in many places where it doesnt make sense.

if we want to have an admin view ( which we may not, though)
we want a link from /sl/econner assignments to go to /class/assn/hangman, say but the username will be the admin user so it will not bring up the proper info.

adding information in urls for parameters to handlers has made things a lot clearer, would it make sense to have assignment urls look like

/paperless/cs106a/SLNAME/assignment/hangman

this way we can control what sls hangman assignments we view. the only change comes as a parameter, but makes it more modular.

the only reason not to put it in the url is if there is some other way of passing this parameter to the function ( i am not aware of another way currently..)

Create Comment Javascript Object

We definitely want a Comment javascript object in terms of managing the code. We also probably want a Shortcut object. The CodeFile object should have a list of Comment objects. A CodeFile can have an isEditable parameter which tells the comments whether they are editable.

The javascript code probably needs some decompositions. any thoughts?

UPDATE:
I've been working on copying the comment related functions in codefile to functions in comment because it makes more sense. no tests yet there, and it does not yet use any of hte comment stuff, but we should transition to it.

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.