jkeesh / paperless Goto Github PK
View Code? Open in Web Editor NEWcode commenting project for the cs198 program
Home Page: paperless.stanford.edu
code commenting project for the cs198 program
Home Page: paperless.stanford.edu
Are we ready?
comments break on re rendering because of newlines. i guess we should turn new lines into line breaks or something
this is because we are trying to access top of a hidden element.... this became an error when we changed from using a set pixel height constant
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
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.
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!
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
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?
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?
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.
Certain ways of clicking put old text in the comment -- issue with current dialog. make sure curernt_dialog is always set correctly
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.
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
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..)
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
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
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
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?
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.
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
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.
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.
similar code .. maybe we can rewrite this so that there is some general createDialog method created that takes a parameter for the starting text.
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.
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
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
im not sure i handled this int the best way, but you can view the header.html template
need to disable code interaction somewhere else, because itsn ot constant per user
highlight current file in file list
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?
the only way i have thought of is to create a user for pointers ip. any other ideas?
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:
Attempt to get all of the classes to standardize a path format.
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??
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
htaccess wizards, please solve this.
If you highlight an area, then X out -- i.e., an empty comment, it should unhighlight
not all namesurfers show.. and thats because they got moved to submissions2.
hopefully adding a symbolic link will fix that
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.
cancel works, submit or tab empty dialog works, but 'x'ing out breaks it...
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?
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
for each assignment, add some sort of overview 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?
forgot about that
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.
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.
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.
gets their role for a class
and checks against permissions
that we we can clear the assignment listing of the old format. if we know the new format starts with lowercase, we only show those.
No idea why this would happen...
Edit:
Oh I see..this is caused by keyboard shortcut usage.. hmmm we need different shortcuts I think? Like a character that is rarely typed because doing a parenthesis = Shift + 0 which causes the comment to get deleted
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.