Changeset 725


Ignore:
Timestamp:
19 Oct 2006, 21:44:48 (18 years ago)
Author:
joachim
Message:

study-level import improvements

Location:
WAeUP_SRP/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r723 r725  
    2828    except:
    2929        return 0
     30
     31def getFloat(s):
     32    try:
     33        return float(s)
     34    except:
     35        return 0.0
    3036
    3137def getStudentByRegNo(self,reg_no): ###(
     
    304310            dcr['carry_level'] = result.get('CarryLevel')
    305311            dcr['grade'] = result.get('Grade')
    306             #d['weight'] = result.get('Weight')
     312            dcr['weight'] = result.get('Weight')
    307313            dlev['verdict'] = result.get('Verdict')
    308             #d['import_id'] = result.get('id')
    309             #gpa = result.get('GPA').replace(',','.')
    310             #d['gpa'] = float(gpa)
     314            dcr['import_id'] = result.get('id')
     315            gpa = result.get('GPA').replace(',','.')
     316            dlev['imported_gpa'] = getFloat(gpa)
    311317            cr.getContent().edit(mapping = dcr)
    312318            l.getContent().edit(mapping = dlev)
  • WAeUP_SRP/trunk/profiles/default/layouts/student_study_level.xml

    r486 r725  
    3434  </property>
    3535  <property name="hidden_readonly_layout_modes"/>
     36  <property name="decimals_number">2</property>
     37 </widget>
     38 <widget name="imported_gpa" meta_type="Float Widget">
     39  <property name="title">GPA</property>
     40  <property name="fields">
     41   <element value="imported_gpa"/>
     42  </property>
     43  <property name="label">GPA(imported)</property>
     44  <property name="label_edit">GPA(imported)</property>
     45  <property name="readonly_layout_modes">
     46   <element value="edit"/>
     47   <element value="create"/>
     48  </property>
     49  <property name="hidden_layout_modes">
     50   <element value="create"/>
     51  </property>
     52  <property name="hidden_readonly_layout_modes"/>
     53  <property name="decimals_number">2</property>
    3654 </widget>
    3755 <widget name="session" meta_type="String Widget">
     
    7997  </row>
    8098  <row>
     99   <cell name="imported_gpa"/>
     100  </row>
     101  <row>
    81102   <cell name="verdict"/>
    82103  </row>
  • WAeUP_SRP/trunk/profiles/default/schemas/student_study_level.xml

    r486 r725  
    66 <field name="status" meta_type="CPS String Field"/>
    77 <field name="verdict" meta_type="CPS String Field"/>
     8  <field name="imported_gpa" meta_type="CPS Float Field"/>
    89</object>
  • WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py

    r724 r725  
    105105    gpaf = (float(sum)/course_count)
    106106gpa = "%4.2f" % gpaf
    107 info['doc'].edit(mapping={'gpa': gpa})
     107info['doc'].edit(mapping={'gpa': gpaf})
    108108info['first'] = first
    109109info['second'] = second
Note: See TracChangeset for help on using the changeset viewer.