Index: waeup_product/trunk/skins/waeup_student/eligibility.py
===================================================================
--- waeup_product/trunk/skins/waeup_student/eligibility.py	(revision 177)
+++ waeup_product/trunk/skins/waeup_student/eligibility.py	(revision 179)
@@ -1,3 +1,3 @@
-##parameters=REQUEST
+##parameters=REQUEST=None
 # $Id$
 """
@@ -5,10 +5,9 @@
 return html renderer + psm
 """
-type_name = 'Jamb'
-ti = context.portal_types[type_name]
-
-REQUEST.set('type_name',type_name)
-
-validate = REQUEST.has_key("cpsdocument_edit_button")
+request = REQUEST
+rget = request.get
+rset = request.set
+fget = request.form.get
+fhas = request.form.has_key
 
 
@@ -16,39 +15,67 @@
 pr = context.portal_registration
 pm = context.portal_membership
+eli = context.ELIGIBILITY.getContent()
+sr = eli.schoolresults
 
-jamb = getattr(context,'JAMB')
-jamb_rendered = jamb.getContent().render(layout_id = 'admission_slip', 
-                               layout_mode = 'view',
-                               schema_id = 'jamb')
-
-res,psm,ds = lt.renderLayout(layout_id= 'student_eligibility',
+res,psm,ds = lt.renderLayout(layout_id= 'student_schoolresults',
                       schema_id= 'student_eligibility',
                       context=context,
-                      mapping=validate and REQUEST,
+                      mapping=request,
                       ob={},
                       layout_mode='create',
+                      formaction = "eligibility",
+                      schoolresults = sr,
                       )
-res = jamb_rendered + res
-if psm == 'invalid':
-    return context.eligibility_form(rendered = res,
+
+inr = 0
+if fhas('add') and (fget('type') or fget('subject') or fget('result')):
+    sr.append((fget('type'),fget('subject'),fget('result')))
+    psm = "new result added"
+elif fhas('change') and fget('keys'):
+    for k in fget('keys'):
+        sr[int(k)] = (fget('type_%s' % k),fget('subject_%s' % k),fget('result_%s' % k))
+        inr += 1
+    psm = "%s items changed" % inr
+elif fhas('delete') and fget('keys'):
+    new = []
+    todelete = fget('keys')
+    for k in range(len(sr)):
+        if str(k) not in todelete:
+            new.append(sr[k])
+    inr = len(todelete)
+    sr = new
+    psm = "%s items deleted" % inr
+else:
+    psm = ''
+eli.edit(mapping={'schoolresults': sr})
+res,dummy,ds = lt.renderLayout(layout_id= 'student_schoolresults',
+                      schema_id= 'student_eligibility',
+                      context=context,
+                      mapping=request,
+                      ob={},
+                      layout_mode='create',
+                      formaction = "eligibility",
+                      schoolresults = sr,
+                      )
+
+return context.eligibility_form(rendered = res,
                                  #psm = str(ds),
-                                 psm = "Please correct your input",
-                                 ds = ds,
+                                 psm = psm,
                                  )
-elif psm == '':
-    return context.eligibility_form(rendered = res,
-                                 psm = None,
-                                 ds = ds,
-                                 )
-elif psm == 'valid':
-    s_personal = context.PERSONAL.getContent()
-    s_personal.edit(mapping={'email': ds.get('email')})
-    #pw = REQUEST.get("widget__pw")
-    #pm.setPassword(pw)
-psm = 'Email has been successfully set.'
-return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students'))
-
-##return context.eligibility_form(rendered = res,
-##                                 psm = psm,
+##elif psm == '':
+##    return context.eligibility_form(rendered = res,
+##                                 psm = None,
 ##                                 ds = ds,
 ##                                 )
+##elif psm == 'valid':
+##    s_personal = context.PERSONAL.getContent()
+##    s_personal.edit(mapping={'email': ds.get('email')})
+##    #pw = REQUEST.get("widget__pw")
+##    #pm.setPassword(pw)
+##psm = 'Email has been successfully set.'
+##return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students'))
+##
+####return context.eligibility_form(rendered = res,
+####                                 psm = psm,
+####                                 ds = ds,
+####                                 )
Index: waeup_product/trunk/skins/waeup_student/eligibility_form.pt
===================================================================
--- waeup_product/trunk/skins/waeup_student/eligibility_form.pt	(revision 177)
+++ waeup_product/trunk/skins/waeup_student/eligibility_form.pt	(revision 179)
@@ -1,5 +1,4 @@
 <tal:block define="rendered_main options/rendered;
                    portal_status_message options/psm;
-                   data_storage options/ds;
                    jamb options/jamb/getContent|nothing;
                    edition python:1;"
@@ -14,5 +13,5 @@
     </metal:block>
       <metal:block fill-slot="main">
-        <h1> Fill in your Email and give a new Password </h1>
+        <h1> Fill in your post-primary school results</h1>
         <div tal:replace="structure rendered_main" />
       </metal:block>
Index: waeup_product/trunk/skins/waeup_student/layout_results_create.pt
===================================================================
--- waeup_product/trunk/skins/waeup_student/layout_results_create.pt	(revision 179)
+++ waeup_product/trunk/skins/waeup_student/layout_results_create.pt	(revision 179)
@@ -0,0 +1,117 @@
+<tal:block define="global creation python:1" />
+<metal:block define-macro="default_edit"
+             tal:define="layout options/layout;
+             ds options/datastructure;
+             creation creation|nothing;
+             metadata metadata|nothing;
+             type_name request/type_name|nothing;
+             ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None);
+             creation_form python:ti and ti.getActionById('create', 'cpsdocument_create_form') or 'cpsdocument_create_form' ;
+             edit_form     python:ti and ti.getActionById('edit',   'cpsdocument_edit_form') or  'cpsdocument_edit_form';
+             metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata';
+             formaction options/formaction;
+             first_layout options/first_layout|python:0;
+             last_layout options/last_layout|python:0;
+             is_flexible options/is_flexible;
+             cpsmcat nocall:here/translation_service;
+             results options/schoolresults;
+             "
+             >
+  <form action='eligibility' method='post' tal:attributes="action formaction"
+        enctype='multipart/form-data' class='workflow'>
+    <table cellspacing="0" cellpadding="2" border="0" width="100%" tal:condition="results|nothing">
+      <tr>
+        <td align="left" valign="top">
+          &nbsp;
+        </td>
+        <td align="left" valign="top">
+          <div>Type</div>
+        </td>
+        <td align="left" valign="top">
+          <div>Subject</div>
+        </td>
+        <td align="left" valign="top">
+          <div>Result</div>
+        </td>
+      </tr>
+      <span tal:repeat="row results" tal:omit-tag="">
+        <tr tal:define="rindex repeat/row/index">
+          <td align="left" valign="top">
+            <input type="checkbox" name="keys:list" value="100" tal:attributes="value string:${repeat/row/index}"/>
+          </td>
+          <td align="left" valign="top">
+            <div>
+              <input type="text" name="key_0" value="100" size="20" 
+                     tal:attributes="name string:type_${rindex};value python:row[0]" />
+            </div>
+          </td>
+          <td align="left">
+            <div class="form-item">
+              <input type="text" name="label_0" value="Year 1 (100 Level)" size="40" 
+                     tal:attributes="name string:subject_${rindex};value python:row[1]" />
+            </div>
+          </td>
+          <td align="left">
+            <div class="form-item">
+              <input type="text" name="msgid_0" value="" size="10" 
+                     tal:attributes="name string:result_${rindex};value python:row[2]" />
+            </div>
+          </td>
+        </tr>
+      </span>
+      <tr>
+        <td align="left" colspan="3">
+          <input type="submit" name="change" value=" Change " />
+          <input type="submit" name="delete" value=" Delete " />
+        </td>
+      </tr>
+    </table>
+    <table cellspacing="0" cellpadding="2" border="0" width="100%">
+      <tr>
+        <td align="left" valign="top" colspan="2">
+          <div>Add a new postprimary school result</div>
+        </td>
+      </tr>
+      <tr>
+        <td align="left" valign="top">
+          &nbsp;
+        </td>
+        <td align="left" valign="top">
+          <div>Type</div>
+        </td>
+        <td align="left" valign="top">
+          <div>Subject</div>
+        </td>
+        <td align="left" valign="top">
+          <div>Result</div>
+        </td>
+      </tr>
+      <tr>
+        <td align="left" valign="top">
+          &nbsp;
+        </td>
+        <td align="left" valign="top">
+          <div>
+            <input type="text" name="type" value="" size="20" /> 
+          </div>
+        </td>
+        <td align="left">
+          <div class="form-item">
+            <input type="text" name="subject" value="" size="40" />
+          </div>
+        </td>
+        <td align="left">
+          <div class="form-item">
+            <input type="text" name="result" value="" size="10" />
+          </div>
+        </td>
+      </tr>
+      <tr>
+        <td align="left" colspan="3">
+          <input type="submit" name="add" value=" Add " />
+        </td>
+      </tr>
+    </table>
+  </form>
+</metal:block>
+  
Index: waeup_product/trunk/skins/waeup_student/personal_addon.py
===================================================================
--- waeup_product/trunk/skins/waeup_student/personal_addon.py	(revision 179)
+++ waeup_product/trunk/skins/waeup_student/personal_addon.py	(revision 179)
@@ -0,0 +1,51 @@
+##parameters=REQUEST
+# $Id$
+"""
+process the Admission Form
+return html renderer + psm
+"""
+type_name = 'Jamb'
+ti = context.portal_types[type_name]
+
+REQUEST.set('type_name',type_name)
+
+validate = REQUEST.has_key("cpsdocument_edit_button")
+
+
+lt = context.portal_layouts
+pr = context.portal_registration
+pm = context.portal_membership
+
+jamb = getattr(context,'JAMB')
+jamb_rendered = jamb.getContent().render(layout_id = 'admission_slip', 
+                               layout_mode = 'view',
+                               schema_id = 'jamb')
+
+res,psm,ds = lt.renderLayout(layout_id= 'student_personal_addon',
+                      schema_id= 'student_personal',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob={},
+                      layout_mode='create',
+                      )
+res = jamb_rendered + res
+if psm == 'invalid':
+    return context.personal_addon_form(rendered = res,
+                                 #psm = str(ds),
+                                 psm = "Please correct your input",
+                                 ds = ds,
+                                 )
+elif psm == '':
+    return context.personal_addon_form(rendered = res,
+                                 psm = None,
+                                 ds = ds,
+                                 )
+elif psm == 'valid':
+    s_personal = context.PERSONAL.getContent()
+    s_personal.edit(mapping={'email': ds.get('email')})
+    #pw = REQUEST.get("widget__pw")
+    #pm.setPassword(pw)
+psm = 'Email has been successfully set. '
+##return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students'))
+
+return context.eligibility()
Index: waeup_product/trunk/skins/waeup_student/personal_addon_form.pt
===================================================================
--- waeup_product/trunk/skins/waeup_student/personal_addon_form.pt	(revision 179)
+++ waeup_product/trunk/skins/waeup_student/personal_addon_form.pt	(revision 179)
@@ -0,0 +1,23 @@
+<tal:block define="rendered_main options/rendered;
+                   portal_status_message options/psm;
+                   data_storage options/ds;
+                   jamb options/jamb/getContent|nothing;
+                   edition python:1;"
+                   >
+<metal:block define-macro="edit_form">
+<metal:block use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="header"
+    tal:define="creation creation|nothing;
+                edition edition|nothing;
+                metadata metadata|nothing"
+                >
+    </metal:block>
+      <metal:block fill-slot="main">
+        <h1> Fillin Your Email</h1>
+        <div tal:replace="structure rendered_main" />
+      </metal:block>
+      <metal:block fill-slot="sub">
+      </metal:block>
+    </metal:block>
+  </metal:block>
+</tal:block>
Index: waeup_product/trunk/skins/waeup_student/process_waeup_login.py
===================================================================
--- waeup_product/trunk/skins/waeup_student/process_waeup_login.py	(revision 177)
+++ waeup_product/trunk/skins/waeup_student/process_waeup_login.py	(revision 179)
@@ -32,5 +32,9 @@
 pkw['aggregate'] = getattr(jc,'aggregate')
 pkw['faculty'] = getattr(jc,'faculty')
+pkw['course'] = getattr(jc,'course')
 pkw['age'] = getattr(jc,'age')
+pkw['jamb_results'] = getattr(jc,'exam_results')
+pkw['jamb_aggregate'] = getattr(jc,'aggregate')
+pkw['jamb_listing_date'] = getattr(jc,'listing_date')
 pkw['state'] = getattr(jc,'state')
 
@@ -43,5 +47,11 @@
 context.notifyCPSDocumentCreation(ob=pd)
 
-return response.redirect("%s/eligibility" % ma.absolute_url())
-return ma.eligibility(REQUEST=context.REQUEST)
+pdid = 'ELIGIBILITY'
+ma.invokeFactory('StudentEligibility', pdid)
+pd = getattr(ma,pdid)
+pd.getContent().edit(mapping=pkw)
+context.notifyCPSDocumentCreation(ob=pd)
 
+return response.redirect("%s/personal_addon" % ma.absolute_url())
+#return ma.personal_addon(REQUEST=context.REQUEST)
+
Index: waeup_product/trunk/skins/waeup_student/register_level.py
===================================================================
--- waeup_product/trunk/skins/waeup_student/register_level.py	(revision 177)
+++ waeup_product/trunk/skins/waeup_student/register_level.py	(revision 179)
@@ -28,6 +28,5 @@
                                  create = 1,
                                  type_name = type_name,
-                                 psm = str(ds),
-                                 #psm = 'Please correct your errors',
+                                 psm = 'Please correct your errors',
                                  )
 elif psm == '':
@@ -36,5 +35,4 @@
                                  type_name = type_name,
                                  psm = psm,
-                                 #psm = str(ds),
                                  )
     
