Monday, August 20, 2012

2012 Summer work summary:


  • add ‘coming soon’ links to user’s friends-DONE
    1. modify accounts_views.py, add friends and comments views
    2. add user.friends.mako to templates

For production server, DO NOT simply replace the files. There are specific code changes for production server.  SEE pyramid.production.server.txt.

  • remove recaptcha-DONE
    1. modify register_view.py, comment out recaptcha functions
    2. modify public.registration.part.1.mako, comment out recaptcha image
    3. modify public.registration.part.2.mako, comment out recaptcha image
    4. modify student.registration.mako, comment out recaptcha image
    5. modify create.class.mako, comment out recaptcha image

  • add thumbnail images-DONE

  1. copy static/css/optimal-touch/images/new/csdt/recent/rec_03.jpg to /uploads/projects/icon_rec_03.jpg, modify icon_rec_03.jpg to size = 150*150, and use icon_rec_03.jpg as default image
  2. edit all.projects.mako AND user.projects.mako AND user.profile.mako AND classroom.mako

  • change height of table to “auto”, which displays accordingly
  • change column width for image
  • add link to default icon image or saved snapshots from projects. NOTE: img_file = “<img src= …>”, stored_proj_name is NOT the same as proj_name. For example, project name = Proj A, stored_proj_name = 1.Proj A. There is also a space in the name. The .jpg generated in /uploads/projects/SB/thumbs has to match the stored_proj_name.

  1. edit teacher.classes.mako, change table height and column width
  2. edit font of jqgrid in /static/js/jqgrid/css/ui.jqgrid.css

  • change classroom flag level-DONE

  1. flag level can be edited/changed at any time
  2. flag means to label inappropriate comments and the teacher will pay attention to them, and determine whether they need to be removed
  3. partial vs. full flag options: the partial class flag level indicates that the teacher will get all flagged comments that a user flags as inappropriate. The full class flag level indicates that all comments when posted will go through the teacher first before actually becoming publicly visible. This is to insure that all comments are appropriate and meet the teacher's satisfaction. All comments under the full class flag level can still get flagged if a user decides to flag a comment as inappropriate.
  4. edit create.class.mako AND edit.class.comment.flag.level.mako,
    • change None/Partial/Full to No/Yes
    • add description to flag level management

  • add user’s comments page-DONE
    • database infomation: config/db/init.sql
    • table for comments: project_comments
    • modify account.py, add function getCommentTableForAUser(self, user_id), and function getSizeOfCommentTableForAUser(self, user_id)
    • modify the account_view.py, add views Resource url = "/accounts/{owner}/comments" and Resource url = "/accounts/{owner}/comments-tables"
    • add user.comments.mako


  • Integrate MG, RW, WW, HI, AG into the system-DONE
    1. located in community_csdt/uploads/projects
    2. Modification to template/**.jnlp file
  • check .jnlp file and .xml file
    1. in ww.xml, content of applet-desc is missing. after upload, proj_type and stored_proj_name are not created.
           adding the following changes to ww.xml file solves the problem:

  1. <project codename="WW" version="0.41" />
  <applet-desc name="pCSDT Applet" main-class="WW.WigwamGui" width="1000" height="600">
        <param name="SingleDemoXmlUrl" value="${xml}"/>
<param name="DemoUrls" value="Default, ${xml}"/>
      </applet-desc>

  1. AG, HI modified to be the same
  2. RW modified to be the same as BL
  3. AG, HI, WW, upload error and cannot be opened
    • reason: projects/**/jnlp/proj_id.proj_name.jnlp is not created
    • createJNLP function is defined in upload.py, and is called in upload_view.py
  4. test uploads

    • agtest, hitest wwtest cannot be opened
    • cctest, bltest work

  • Here are the URLs for all the abbreviations:

  • AG
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/AG/
  • BD
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/BD/
  • BL
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/BL/
  • CC
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/CC/
  • GG
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/GG/
  • HI
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/HI/
  • KC
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/KC/
  • MG
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/MG/
  • RW
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/RW/
  • SB
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/SB/
  • WW
  • http://www.ccd.rpi.edu/eglash/csdt/pcsdt/WW/


    • check log:
    1. Patrick: The reason for the problem not showing up every time is probably due to some variance in the values being queried to the database; some of the values might be good, whereas others might trigger the problem. One of the things you can do to debug the problem is to look at the log and see what the sql queries are being made for the specified view/controller. Run and test the queries against the database and see if it returns satisfactory results. Another thing would be to look at the javascript code and see what urls they call, and then deduce what view/controller is called from it. From there you can look at the different models it calls and deduce what could be wrong with the sql query.
    2. Jay suggested that we could also look at the apache2 server log, which is located in /home/community/log/error.log. For real-time view of the log: tail -f error.log. 

    • error: happens when a user is logged in and a project is clicked.

    1. pop-up error messages:
    Fail - Code: [object Object] textStatus: error error thrown: Internal Server Error
    code for the error message is in templates

    1. project always ‘loading’, cannot display
    2. user login no response
    3. all joinable classes always ‘loading’

    • scratch: friends
      1. after login, and click on other users’ profiles, there is an “add to friends” link (if this person is not added to friends before). Click on the link, the person will be notified.

    Tuesday, August 14, 2012



    1. continue integrating JNLP and xml files for various projects into the system (JNLP File Modifications Needed)

    • check .jnlp file and .xml file
      1. in ww.xml, content of applet-desc is missing
      2. AG, HI modified to be the same
      3. RW modified to be the same as BL
      4. AG, HI, WW, upload error and cannot be opened
        • reason: projects/**/jnlp/proj_id.proj_name.jnlp is not created
        • createJNLP function is        defined in upload.py, and is called in upload_view.py


    changed classroom flag level to No/Yes

  • add user’s comments page

      • database infomation: config/db/init.sql
      • table for comments: project_comments
      • modify account.py, add function getCommentTableForAUser(self, user_id), and function getSizeOfCommentTableForAUser(self, user_id)
      • modify the account_view.py, add views Resource url = "/accounts/{owner}/comments" and Resource url = "/accounts/{owner}/comments-tables"
      • NEXT: add user.comments.mako

    Tuesday, July 31, 2012

    classroom flag level
      1. edit create.class.mako, change None/Partial/Full to No/Yes
      2. edit edit.class.comment.flag.level.mako, change None/Partial/Full to No/Yes

    website crashing problem
      1. happens when a user is logged in and a project is clicked.
      2. pop-up error messages: 
          Fail - Code: [object Object] textStatus: error error thrown: Internal Server Error
      3. code for the error message is in templates
      4. project always ‘loading’, cannot display
      5. user login no response
      6. all joinable classes always ‘loading’

    check log:
      1. log for the most recent session is not updated until the website is re-installed 
      2. log clearly shows attempts on the website, but not results 
      3. has not located the reason for crash

    Wednesday, July 25, 2012

    Patrick's todo list+myown

    CSDT ToDo List
    ** High Priority **
    0) Fix crashing of the website
    1) Continue integrating JNLP and xml files for various projects into the system (JNLP File Modifications Needed)
       - Missing (MG, RW, WW)
       - Support (BD, BL, CC, GG, KC, SB)
       - WW xml file needs the project portion in xml filled with <project codename="WW" version="0.4" />
    2) User profiles (with his uploads and images)
       - Change Email
       - Notifications
       - Favorite Projects
       - Friends
       - Comments
       - Add more information about themselves (member since, lasted logged in,...)
       - Default avatar images for user to choose
    3) Delete button
    4) Add a comments option for each project
       - Keep track of rating for each comment (likes)
       - Support reply for each individual comment
       - Limit the number of comments shown on the screen (like 20) - have a read all comments link for people to click if they so choose
    5) Update user log whenever a user logs in and out
    6) Create personalized thumbnail of each project
    ** Medium Priority **
    1) If you click the teacher's username, you should be prompted to all of the classes that he/she manages
    2) Stay on same page - remember the url you were previously at
      - Whenever someone clicks a link and is brought to a login screen, once they login, they should be brought back to that page, rather than home
      - After you upload, etc., stay on the same page
    3) Determine whether a link is active or not using <li class="active"> to mark it. Determine what page you are currently on.
    4) Support - place a link
    5) Search functionality on the home page
       - Support searching of projects, classrooms, and users
    6) Recently uploaded projects table
    7) OP can make changes to their post or delete it
    8) Limit the number of students that can participate in a classroom - 1000 users
    ** Low Priority **
    1) https (ssl) for login
    2) Create thumbnail of each project
    3) Encrypt password using SHA-1 or SHA-2
    4) Add a forum - use something already made
    5) Add a blog - use something already made
    ** Security **
     - captcha - someway to hide private key
     - ssl (https)
     - javascript does the sha1
     - request for a site certificate
     - expiring cookies - place a timestamp and nonce to protect against someone tampering it
    ** CSDT - Overview **
    1) Return success or failure to users on Ajax call. Needs to remember the state that they were entered in previously.
    2) More helpful messages on form validation
    3) Better use of cookies to remember things as well as choosing better names
    4) Active vs non-active users, projects, etc
    5) Names of jqgrid tables - want it to be specific to user, like the user's first and last name, etc.
    6) Get rid of alerts and place dialog boxes in its place
    7) mako template file - thanks user for registering (Public Registration Part 1)
    8) Do more thorough HTTP Error Checking
        - Only students registered in a class can see that class - check other users even if they are logged in
    ** Questions and Answers **
    - Should an avatar image be added?
        Yes
    - Should we keep track the number of times that a user has flagged certain messages
        No not necessary - but good to have
    - Should we have a timestamp of when a user flags a message
        Yes
    - When a comment is banned, what should we do with it? Should we remove it completely from the database?
        No
    - Should we keep track of timestamp when we delete a project or user?
        Yes
    - Do we need to know how many and who the people are who flagged the message
        Yes - to know who is spamming them
    - Do we need to send a message out to the teacher to inform them that a message was flagged
        Don't send them any email - allow them to switch out
    - Delete - save project and user data or just remove it from database?
        1 Month for everyone
        Daily program that checks if one month passes for deleted project, remove it from server
    - Should we allow users to change their username?
      - NO
    - Should we allow teachers to change their class name?
      - NO
    - Where should we send our comment flags to if there is no teacher? Who is the mediator?
      - Create a new group level called admin
      - Fake Admin
    - Should we allow a user to upload a project to multiple classes or to just one particular class?
      - Yes
    - Continue integrating JNLP and xml files for various projects into the system (JNLP File Modifications Needed)
       - Missing (FQ, MG, RW, WW)
       - Support (BD, BL, CC, GG, KC, SB)
       - WW xml file needs the project portion in xml filled with <project codename="WW" version="0.4" />
    - Should the flag comment level affect all classrooms that a user owns? Or just a particular one?
       - Individual
    - If user is part of other classes, should their projects be visible by all classes or just the ones of their choosing?
       - have a setting which allows the user the choice of priviledges they want for their project
    - When someone deletes a class, should i completely remove it from the database or have a visible column and keep the data still on the server?
       - downside is classname does not become available again...
       - rename deleted class (unique)
       - timestamp of delete
    - Visible and non-visible stuff
       - Visible (Whether or not the item has been deleted)
       - Hidden (Hide users from being seen) - Default
    ** Work On **
    1) Where should we send our comment flags to? Who is the mediator?
       - Create new group called mediators
       - Add user in the mediator group
    2) For Flagged Comments Table - add timestamp of when each comment is flagged - not the time that the comment was actually created
    3) If a project is deleted:
       - set active = 0 in the projects table
       - delete all entries of the project id from the project_stats table
       - delete all entries of the project id from the project_ratings table
    4) Delete button
    5) Comments
       - Reply
       - Limit the number of comments shown on the screen (like 20) - have a read all comments link for people to click if they so choose
    6) Notification and email functionality for users
    7) Have a notification for whenever a teacher logins if there are flagged comments
    8) Allow users to move projects in and out of various classrooms after they have been uploaded
    9) Should galleries page show all classrooms available or only ones that are visible? (Visiblity indicates whether or not the classroom is viewable publically or only seen privately). Default - everything is currently always visible
    10) Some way for users to remove themselves from a class
    11) Should create an option of whether or not a classroom teacher wants to monitor all comments (public teacher doesn't want to monitor anything)
        - Every class should have the option to change it

    Tuesday, July 24, 2012

    Classroom flag level
    1. flag level can be edited/changed at any time
    2. flag means to label inappropriate comments and the teacher will pay attention to them, and determine whether they need to be removed
    3. partial vs. full flag options: both include flag projects and flag comments.
    4. add description to flag level management, edit.class.comment.flag.level.mako
    5. SUGGEST to remove 3 options, just keep yes or no

    Thumbnails

    1. use icon_rec_03.jpg as default image, size = 150*150
    2. edit all.projects.mako, column width for image, and add link to default icon image or saved snapshots from projects.
    3. NOTE: img_file = “<img src= …>”, stored_proj_name is NOT the same as proj_name. For example, project name = Proj A, stored_proj_name = 1.Proj A. There is also a space in the name. The .jpg generated in /uploads/projects/SB/thumbs has to match the stored_proj_name.
    4. change height of table to 1500, which will display 10 projects
    5. edit font of jqgrid in /static/js/jqgrid/css/ui.jqgrid.css

    Tuesday, July 17, 2012


    I fixed the egg file problem and removed the recaptcha in public registration part 1 and 2 and in student registration. I tested registrations as both public accounts and student accounts.
    In pyramid.production.server.txt, '14) Creating an egg' is not well explained.
    It has to take two steps:
    1) ../bin/python setup.py install 
    2) ../bin/python setup.py develop 
    1) In env/community_csdt, after ../bin/python setup.py install, community_csdt-0.0-py2.7.egg, along with required packages in setup.py, are created in the env/lib/python2.7/site-packages.  Note: it has to be the python in the ../bin. Using python setup.py install will install those files into usr/lib/python2.7/dist-packages.
    It has to be env/lib/python2.7/site-packages, because it is specified in /etc/apache2/conf.d/wsgi.conf. 
    For more information: 
    Running a Pyramid Application under mod_wsgi
    http://docs.pylonsproject.org/projects/pyramid/en/latest/tutorials/modwsgi/index.html?awesome
    2) The project has to be developed in order for the server to work. ../bin/python setup.py develop will install/update the egg-link file in env/lib/python2.7/site-packages.

    Wednesday, July 4, 2012


    Work log June 27 - July 4


    I have fixed the user's friends and comments webpage errors.
    I also tried to remove recaptcha. During the process, I found that the changes in the code failed to reflect on the website, i.e. python setup.py install did not update the website. After communicating to Patrick, he revealed that the file that server uses was .egg file. I am still trying to figure out why python setup.py install fails to update the .egg file.


    Next:
    Working on thumbnails of projects.