Changeset 1179 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
2 Jan 2007, 21:29:17 (18 years ago)
Author:
Henrik Bettermann
Message:

GPA calculation
medical hostel allocation corrected
and beautifying

Location:
WAeUP_SRP/trunk/skins
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_default/srp_anonymous_view.pt

    r1131 r1179  
    55          <br />New Student Registration Portal of the University of Benin, Nigeria</h2>
    66        <br />
    7         <p>This is the frontpage of Uniben's Student Registration Portal (SRP) which is part
     7        <strong>This is the frontpage of Uniben's Student Registration Portal (SRP) which is part
    88           of the West African e-University Project
    9            (<a href="" tal:attributes="href string:http://waeup.org">WAeUP</a>).
    10            At present, fresh students can view their 2006 PUME/PDE results and admission status (free of charge):</p>
     9           (<a href="" tal:attributes="href string:http://waeup.org">WAeUP</a>).</strong>
     10         
     11          <br />  <br />     
     12         
     13          <h3>Returning Students</h3>         
     14         
     15          <p>can view their 2006 session results, log into the portal, update their personal data and book accommodation on campus:</p>
     16         
     17          <br />
     18          <ul>
     19          <li> Simply click "View Sess. Results", </li>
     20          <li> enter your Matriculation Number and either your firstname, middlename or lastname</li>
     21          <li> press the "Search" button. </li>
     22          </ul>
     23          <br />
     24          <p>Your 2006 session results will be shown. Please check the data.
     25             Then proceed to create your member and student records .</p>
     26         
     27          <br />
     28          <ul>
     29          <li> Press the "Continue to Login" button, </li>
     30          <li> check if you are the designated person on the access data form,</li>
     31          <li> enter your email address and phone number,</li>
     32          <li> choose and verify your password (minimum size 5, at least 1 digit),</li>
     33          <li> tick the acknowledgement check box,</li>           
     34          <li> press the "Save & First-time Login" button. </li>
     35          </ul>
     36          <br />
     37         
     38         
     39         
     40         
     41          <hr>
     42         
     43          <h3>New Students</h3>
     44
     45          <p>can view their 2006 PUME/PDE results and admission status (free of charge):</p>
    1146          <br />
    1247          <ul>
     
    5085          <strong><a target="_blank" href="http://files.saoas.org/Procedure_for_clearance.pdf">UME</a></strong>,
    5186          <strong><a target="_blank" href="http://files.saoas.org/Procedure_for_clearance_Direct.pdf">DE</a></strong> (1 page).
    52           After clearance you are eligible for booking your accommodation on campus.
     87          After being cleared you are eligible for booking your accommodation on campus.
    5388          </p>
    5489          <br />
  • WAeUP_SRP/trunk/skins/waeup_student/getAccommodationInfo.py

    r1178 r1179  
    6565review_state = info['review_state'] = wf.getInfoFor(student,'review_state',None)
    6666booking_allowed = False
    67 if not review_state not in ('cleared_and_validated',):
     67if review_state in ('returning','school_fee_paid','courses_registered', 'courses_validated',):
    6868    res = context.results_import(matric_no = s_brain.matric_no)
    6969    if res:
    7070        booking_allowed = res[0].Verdict in ("SUCCESSFUL STUDENT",
    7171                                             "STUDENT WITH CARRYOVER COURSES",)
    72 else:
     72elif review_state in ('cleared_and_validated',):
    7373    booking_allowed = True
    74 info['booking_allowed'] = booking_allowed   
     74info['booking_allowed'] = booking_allowed
    7575if not booking_allowed:
    7676    return info
     
    102102elif s_brain.course in pti_certificates:
    103103    bt += "_pti"
    104 elif s_brain.faculty in ('MED') and int(s_brain.level) >= 400:
     104elif s_brain.faculty in ('MED') and int(s_brain.level) >= 500:
    105105    bt += "_med"
    106106
  • WAeUP_SRP/trunk/skins/waeup_student/getSessionResults.py

    r1174 r1179  
    5858with_courses_cat = hasattr(context,'courses_catalog')
    5959fields = context.results_import.schema()
     60gpa = 0
     61course_count = 0
    6062for r in results:
    6163    result = {}
     
    6668    if with_courses_cat and res:
    6769        result['title'] = res[0].title
     70        result['credits'] = res[0].credits
     71        try:
     72            weight = int(result['WEIGHT'])
     73            credits = int(res[0].credits)
     74            gpa_course =  int(res[0].credits) * weight
     75            gpa += gpa_course
     76            course_count += credits
     77            result['gpa'] = 'ok'
     78        except:
     79            result['gpa'] = 'na'
    6880    else:
    69         result['title'] = "To Be Determined"
     81        result['title'] = "na"
     82        result['credits'] = "na"
     83        result['gpa'] = 'na'
    7084    if r.Semester == '2':
    7185        sem2.append(result)
    7286    else:
    7387        sem1.append(result)
     88
     89if course_count:
     90    gpa = float(gpa) / course_count
     91    gpa = "%4.2f" % gpa
     92info['gpa'] = gpa
    7493info['results'] = (sem1, sem2)
    7594info['student'] = student
    7695info['s_id'] = student_id
    7796return info
     97
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py

    r1171 r1179  
    6868info['url'] = student.absolute_url()
    6969info['student_doc'] = student.getContent()
    70 #info['app'] = student.application
    71 #info['app_doc'] = student.application.getContent()
     70info['app'] = student.application
     71info['app_doc'] = student.application.getContent()
    7272#info['per'] = getattr(student,'personal',None)
    7373#info['sex'] = 'male'
     
    149149        row['s_edit_link'] = "%s/%s" % (soo.absolute_url(),se_link)
    150150    row['review_state'] = so.review_state
    151     row['display'] = so.review_state in ('opened','closed','bed_reserved','maintenance_fee_paid',) and so.portal_type != 'StudentPume' or so.portal_type == 'StudentStudyCourse'
     151    if info['review_state'] in ('returning',
     152                                'school_fee_pin_entered',
     153                                'courses_registered',
     154                                'courses_validated',):
     155          row['display'] = so.review_state in ('opened',
     156                                               'bed_reserved',
     157                                               'maintenance_fee_paid',) or so.portal_type == 'StudentStudyCourse'
     158    else:
     159          row['display'] = so.review_state in ('opened',
     160                                               'closed',
     161                                               'bed_reserved',
     162                                               'maintenance_fee_paid',) and\
     163                           so.portal_type not in ('StudentPume',) or\
     164                           so.portal_type == 'StudentStudyCourse'
     165   
    152166    items.append(row)
    153167info['items'] = items
    154 
    155168request.set('student_id',student_id)
    156169request.set('student_url',info['url'])
  • WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt

    r1177 r1179  
    5555      <div tal:condition="registered">
    5656        <span tal:condition="python: registered == 'no_student_object'">
    57           Your Datafiles have not yet been created, please check again later.
     57          Your student and member record have not yet been created, please check again later.
    5858        </span>
     59        <font color="red">
    5960        <span tal:condition="python: registered != 'no_student_object'">
    60           You have already set your Password, please
     61          You have already set your password, please
    6162          <a href="" tal:attributes="href string:${context/portal_url}/login_student">login</a>
    62           with your UserId <span tal:replace="registered" />
     63          with your Student Id <span tal:replace="registered" />.
    6364        </span>
     65        </font>
    6466      </div>
    6567      <form tal:condition="not: registered" action="" method="post"
  • WAeUP_SRP/trunk/skins/waeup_student/session_results_slip.pt

    r1174 r1179  
    2929        </tr>
    3030        <tr>
    31           <th>Course of Study:</th><td tal:content="info/student/Coursemajor" />                     
     31          <th valign="top">Course of Study:</th><td tal:content="info/student/Coursemajor" />                     
    3232        </tr>
    3333        <tr>
     
    3838       <table>
    3939          <tr>
    40             <th width="180px">Verdict:</th><td tal:content="python:info['results'][0][0]['Verdict']" />
     40            <th valign="top" width="180px">Verdict:</th><td tal:content="python:info['results'][0][0]['Verdict']" />
    4141          </tr>
    4242          <tr> 
    4343            <th>Session:</th><td tal:content="python:info['results'][0][0]['Session']" />
    44           </tr>       
     44          </tr>
     45          <tr> 
     46            <th valign="top">GPA:</th><td> <span tal:content="info/gpa" /> (on the basis if the data below)  </td>
     47          </tr>                   
    4548       </table>
    4649
     
    5154            <span tal:repeat="result semester">
    5255             <tr tal:condition="repeat/result/start">
    53               <th colspan="5">
    54                 <span tal:replace="python: test(repeat['semester'].index,'Second','First')" /> Semester
    55               </th>
    56              </tr>
     56                <th colspan="2">
     57                   <span tal:replace="python: test(repeat['semester'].index,'Second','First')" /> Semester
     58                </th>
     59                <td>Grade</td>
     60                <td>Weight</td>
     61                <td>Credits</td>
     62             </tr>             
    5763            <tr>     
    58             <td width="80px" tal:content="result/CosCode" />
    59             <td tal:content="result/title" />
    60             <td width="50px" align="center" tal:content="result/GRADE" />
     64            <td valign="top" width="80px" tal:content="result/CosCode" />
     65            <td valign="top" tal:content="result/title" />
     66            <td valign="top" width="50px" align="center" tal:content="result/GRADE" />
     67            <td valign="top" width="50px" align="center" tal:content="result/WEIGHT" />
     68            <td valign="top" width="50px" align="center" tal:content="result/credits" />
     69
    6170          </tr>
    6271        </span>
     72        <tr><td colspan="5">&nbsp;</td></tr>
    6373        </span>
    6474      </table>
  • WAeUP_SRP/trunk/skins/waeup_student/session_results_view.pt

    r1176 r1179  
    2929        </tr>
    3030        <tr>
    31           <th>Course of Study:</th><td tal:content="info/student/Coursemajor" />                     
     31          <th valign="top">Course of Study:</th><td tal:content="info/student/Coursemajor" />                     
    3232        </tr>
    3333        <tr>
     
    3838       <table>
    3939          <tr>
    40             <th width="180px">Verdict:</th><td tal:content="python:info['results'][0][0]['Verdict']" />
     40            <th valign="top" width="180px">Verdict:</th><td tal:content="python:info['results'][0][0]['Verdict']" />
    4141          </tr>
    4242          <tr> 
    4343            <th>Session:</th><td tal:content="python:info['results'][0][0]['Session']" />
    44           </tr>       
     44          </tr>
     45          <tr> 
     46            <th valign="top">GPA:</th><td> <span tal:content="info/gpa" /> (on the basis if the data below)  </td>
     47          </tr>                   
    4548       </table>
    4649
     
    5154            <span tal:repeat="result semester">
    5255             <tr tal:condition="repeat/result/start">
    53               <th colspan="5">
    54                 <span tal:replace="python: test(repeat['semester'].index,'Second','First')" /> Semester
    55               </th>
    56              </tr>
     56                <th colspan="2">
     57                   <span tal:replace="python: test(repeat['semester'].index,'Second','First')" /> Semester
     58                </th>
     59                <td>Grade</td>
     60                <td>Weight</td>
     61                <td>Credits</td>
     62             </tr>             
    5763            <tr>     
    58             <td width="80px" tal:content="result/CosCode" />
    59             <td tal:content="result/title" />
    60             <td width="50px" align="center" tal:content="result/GRADE" />
     64            <td valign="top" width="80px" tal:content="result/CosCode" />
     65            <td valign="top" tal:content="result/title" />
     66            <td valign="top" width="50px" align="center" tal:content="result/GRADE" />
     67            <td valign="top" width="50px" align="center" tal:content="result/WEIGHT" />
     68            <td valign="top" width="50px" align="center" tal:content="result/credits" />
     69
    6170          </tr>
    6271        </span>
     72        <tr><td colspan="5">&nbsp;</td></tr>
    6373        </span>
    6474      </table>
  • WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py

    r1178 r1179  
     1##parameters=REQUEST,matric_no
     2# $Id$
     3"""
     4process the Application Form
     5return html renderer + psm
     6"""
     7import DateTime,logging
     8current = DateTime.DateTime()
     9pr = context.portal_registration
     10logger = logging.getLogger('Returning')
     11validate = REQUEST.has_key("cpsdocument_edit_button")
     12
     13lt = context.portal_layouts
     14#pr = context.portal_registration
     15default = {'matric_no':matric_no}
     16st_res = context.students_catalog(matric_no = matric_no)
     17if st_res:
     18    sid = st_res[0].id
     19else:
     20    logger.info('"%s","Studentobject does not exist"' % matric_no)
     21res,psm,ds = lt.renderLayout(layout_id= 'student_session_results_search',
     22                      schema_id= 'student_returning',
     23                      context=context,
     24                      mapping=validate and REQUEST,
     25                      ob=default,
     26                      layout_mode='edit',
     27                      formaction = "set_access_data",
     28                      button = "Search",
     29                      matric_no = matric_no,
     30                      commit = False,
     31                      )
     32if psm == '':
     33    return context.set_access_data_form(rendered = res,
     34                                 psm = None,
     35                                 firstlayout = True,
     36                                 lastlayout = True,
     37                                 ds = ds,
     38                                 name = "%(name)s" % REQUEST.form
     39                                 )
     40elif psm == 'invalid':
     41    psm = "Please correct your input!"
     42elif psm == 'valid' and not REQUEST.form.has_key('acknowledge'):
     43    psm = "You did not check the ackkowledge box!"
     44else:
     45    psm = ''
     46if psm != '':
     47    return context.set_access_data_form(rendered = res,
     48                                 #psm = "%s, %s" % (psm,ds),
     49                                 psm = psm,
     50                                 firstlayout = True,
     51                                 lastlayout = True,
     52                                 ds = ds,
     53                                 name = "%(name)s" % REQUEST.form
     54                                 )
     55password = REQUEST.get('widget__password')
     56email = ds.get('email')
     57context.waeup_tool.makeStudentMember(sid,password=password)
     58args = {}
     59args['__ac_name'] = sid
     60args['__ac_password'] = password
     61args['returning'] = '1'
     62args['email'] = email
     63args['phone_nr'] = ds.get('phone_nr')
     64from urllib import urlencode
     65url = "%s/logged_in?%s" % (context.absolute_url(),urlencode(args))
     66return REQUEST.RESPONSE.redirect(url)
Note: See TracChangeset for help on using the changeset viewer.