Index: /WAeUP_SRP/trunk/Widgets.py
===================================================================
--- /WAeUP_SRP/trunk/Widgets.py	(revision 793)
+++ /WAeUP_SRP/trunk/Widgets.py	(revision 794)
@@ -320,4 +320,75 @@
 ###)
 
+class WAeUPResultsWidget(CPSStringWidget): ###(
+    """ WAeUPResults Widget"""
+    meta_type = "WAeUp Results Widget"
+
+    def prepare(self, datastructure, **kw): ###(
+        """Prepare datastructure from datamodel."""
+        datamodel = datastructure.getDataModel()
+        v = datamodel[self.fields[0]]
+        #import pdb;pdb.set_trace()
+        clear_doc = self.getStudentInfo()['clear_doc']
+        vd = getattr(clear_doc,self.fields[0],None)
+        if not vd:
+            vd = {}
+        widget_id = self.getWidgetId()
+        datastructure[widget_id] = vd
+        datastructure[widget_id+'_s'] = ''
+        datastructure[widget_id+'_g'] = ''
+    ###)
+
+    def validate(self, datastructure, **kw): ###(
+        """Validate datastructure and update datamodel."""
+        #import pdb;pdb.set_trace()
+        widget_id = self.getWidgetId()
+        v = datastructure[widget_id]
+        err = 0
+        s = datastructure[widget_id+'_s'].strip()
+        g = datastructure[widget_id+'_g'].strip()
+        if not s and g:
+            err = "no subject grad for subject %s " % s
+        elif v.has_key(s):
+            err = "grad for subject %s already given" % s
+        elif s and g:
+            v[s] = g
+        if err:
+            datastructure.setError(widget_id, err)
+        else:
+            datamodel = datastructure.getDataModel()
+            datamodel[self.fields[0]] = v
+            datastructure[widget_id+'_s'] = s
+            datastructure[widget_id+'_g'] = g
+        return not err
+    ###)
+
+    def render(self, mode, datastructure, **kw): ###(
+        """Render in mode from datastructure."""
+        render_method = 'widget_waeup_result_render'
+        meth = getattr(self, render_method, None)
+        if meth is None:
+            raise RuntimeError("Unknown Render Method %s for widget type %s"
+                               % (render_method, self.getId()))
+
+        # XXX AT: datastructure has to be set again here, in case we're in edit
+        # or create mode, because a default value has to be provided.
+        #import pdb;pdb.set_trace()
+        datamodel = datastructure.getDataModel()
+        widget_id = self.getWidgetId()
+        v = datamodel[self.fields[0]]
+        datastructure[widget_id] = [{'subject': f,
+                                     'grade': v[f]} for f in v.keys()]
+        datastructure[widget_id+'_s'] = ''
+        datastructure[widget_id+'_g'] = ''
+        return meth(mode=mode,
+                    datastructure=datastructure,
+                    )
+    ###)
+
+
+InitializeClass(WAeUPResultsWidget)
+widgetRegistry.register(WAeUPResultsWidget)
+###)
+
 class ScratchCardPin: ###(
     """the ScratchCardPin"""
@@ -410,4 +481,5 @@
                 s_id = student.getId()
                 if ok == 2:
+                    err = "You already used this PIN please login"
                     break
                 student.getContent().makeStudentMember(s_id,password=pin[4:])
Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_clearance_fe.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_clearance_fe.xml	(revision 793)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_clearance_fe.xml	(revision 794)
@@ -116,4 +116,15 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
+ <widget name="alr_results" meta_type="WAeUp Results Widget">
+ <property name="title">Results</property>
+ <property name="fields">
+  <element value="alr_results"/>
+ </property>
+ <property name="label">Results</property>
+ <property name="label_edit">Results</property>
+ <property name="readonly_layout_modes"/>
+ <property name="hidden_layout_modes"/>
+ <property name="hidden_readonly_layout_modes"/>
+</widget>
  <widget name="alr_scan" meta_type="Image Widget">
   <property name="title">Scan of Advanced Level Result</property>
@@ -341,5 +352,16 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
- <widget name="fst_sit_scan" meta_type="Image Widget">
+ <widget name="fst_sit_results" meta_type="WAeUp Results Widget">
+ <property name="title">Results</property>
+ <property name="fields">
+  <element value="fst_sit_results"/>
+ </property>
+ <property name="label">Results</property>
+ <property name="label_edit">Results</property>
+ <property name="readonly_layout_modes"/>
+ <property name="hidden_layout_modes"/>
+ <property name="hidden_readonly_layout_modes"/>
+</widget>
+  <widget name="fst_sit_scan" meta_type="Image Widget">
   <property name="title">Scan of First Sitting Result</property>
   <property name="fields">
@@ -654,4 +676,15 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
+ <widget name="scd_sit_results" meta_type="WAeUp Results Widget">
+ <property name="title">Results</property>
+ <property name="fields">
+  <element value="scd_sit_results"/>
+ </property>
+ <property name="label">Results</property>
+ <property name="label_edit">Results</property>
+ <property name="readonly_layout_modes"/>
+ <property name="hidden_layout_modes"/>
+ <property name="hidden_readonly_layout_modes"/>
+</widget>
  <widget name="scd_sit_scan" meta_type="Image Widget">
   <property name="title">Scan of Second Sitting Result</property>
@@ -765,4 +798,7 @@
   </row>
   <row>
+   <cell name="fst_sit_results"/>
+  </row>
+  <row>
    <cell name="fst_sit_scan"/>
   </row>
@@ -780,4 +816,7 @@
   </row>
   <row>
+   <cell name="scd_sit_results"/>
+  </row>
+  <row>
    <cell name="scd_sit_scan"/>
   </row>
@@ -790,4 +829,7 @@
   <row>
    <cell name="alr_date"/>
+  </row>
+  <row>
+   <cell name="alr_results"/>
   </row>
   <row>
Index: /WAeUP_SRP/trunk/profiles/default/schemas/student_clearance.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/schemas/student_clearance.xml	(revision 793)
+++ /WAeUP_SRP/trunk/profiles/default/schemas/student_clearance.xml	(revision 794)
@@ -21,4 +21,5 @@
  <field name="fst_sit_date" meta_type="CPS DateTime Field"/>
  <field name="fst_sit_type" meta_type="CPS String Field"/>
+ <field name="fst_sit_results" meta_type="CPS SubObjects Field"/>
  <field name="fst_sit_scan" meta_type="CPS Image Field"/>
 
@@ -28,4 +29,5 @@
  <field name="scd_sit_date" meta_type="CPS DateTime Field"/>
  <field name="scd_sit_type" meta_type="CPS String Field"/>
+ <field name="scd_sit_results" meta_type="CPS SubObjects Field"/>
  <field name="scd_sit_scan" meta_type="CPS Image Field"/>
 
@@ -33,4 +35,5 @@
  <field name="alr_no" meta_type="CPS String Field"/>
  <field name="alr_date" meta_type="CPS DateTime Field"/>
+ <field name="alr_results" meta_type="CPS SubObjects Field"/>
  <field name="alr_scan" meta_type="CPS Image Field"/>
 
Index: /WAeUP_SRP/trunk/skins/waeup_student/application_edit.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/application_edit.py	(revision 793)
+++ /WAeUP_SRP/trunk/skins/waeup_student/application_edit.py	(revision 794)
@@ -41,5 +41,6 @@
 psm = ""
 args = {}
-action = "/application_edit_view"
+action = "/application_edit_form"
+base_url = app.absolute_url()
 if cpsdocument_edit_button:
     if is_valid:
@@ -52,7 +53,8 @@
     if is_valid:
         action = "/request_clearance"
+        base_url = clear.absolute_url()
     else:
         psm = 'psm_content_error'
 args['portal_status_message'] = psm
-url = app.absolute_url() + action + '?' + urlencode(args)
+url = base_url + action + '?' + urlencode(args)
 REQUEST.RESPONSE.redirect(url)
Index: /WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt	(revision 794)
+++ /WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt	(revision 794)
@@ -0,0 +1,21 @@
+<metal:html tal:define="info context/getStudentInfo;
+            rendered_main python:info['app_doc'].render(layout_mode='edit',
+                      proceed = request.get('proceed'),
+                      schema_id = 'student_application',
+                      layout_id = 'student_application_fe',
+                      request=request, proxy=info['app'],
+                      use_session=True, no_form=True)">
+  <metal:body use-macro="here/waeup_content_master/macros/master">
+    <metal:main fill-slot="main">
+      <span tal:condition="not: info">
+        <metal:block use-macro="here/error_not_found/macros/not_found" />
+      </span>
+      <span tal:condition="info"
+            tal:define="review_state info/review_state">
+        <h3>Upload or Change your Passport Picture!</h3>
+        <br />
+        <span tal:omit-tag="" tal:replace="structure rendered_main"/>
+      </span>
+    </metal:main>
+  </metal:body>
+</metal:html>
Index: eUP_SRP/trunk/skins/waeup_student/application_edit_view.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/application_edit_view.pt	(revision 793)
+++ 	(revision )
@@ -1,21 +1,0 @@
-<metal:html tal:define="info context/getStudentInfo;
-            rendered_main python:info['app_doc'].render(layout_mode='edit',
-                      proceed = request.get('proceed'),
-                      schema_id = 'student_application',
-                      layout_id = 'student_application_fe',
-                      request=request, proxy=info['app'],
-                      use_session=True, no_form=True)">
-  <metal:body use-macro="here/main_template/macros/master">
-    <metal:main fill-slot="main">
-      <span tal:condition="not: info">
-        <metal:block use-macro="here/error_not_found/macros/not_found" />
-      </span>
-      <span tal:condition="info"
-            tal:define="review_state info/review_state">
-        <h3>Upload or Change your Passport Picture!</h3>
-        <br />
-        <span tal:omit-tag="" tal:replace="structure rendered_main"/>
-      </span>
-    </metal:main>
-  </metal:body>
-</metal:html>
