243:
244: FUNCTION get_avail_cp (p_person_id igs_as_su_stmptout.person_id%TYPE,
245: p_course_cd igs_as_su_stmptout.course_cd%TYPE,
246: p_core_ind_code igs_pr_ul_mark_dtl.core_indicator_code%TYPE,
247: p_unit_level igs_pr_ul_mark_cnfg.unit_level%TYPE)
248: RETURN NUMBER
249: IS
250: -- cursor to get the sum of available cp
251: CURSOR c_avail_cp (cp_person_id igs_as_su_stmptout.person_id%TYPE,
250: -- cursor to get the sum of available cp
251: CURSOR c_avail_cp (cp_person_id igs_as_su_stmptout.person_id%TYPE,
252: cp_course_cd igs_as_su_stmptout.course_cd%TYPE,
253: cp_core_ind_code igs_pr_ul_mark_dtl.core_indicator_code%TYPE,
254: cp_unit_level igs_pr_ul_mark_cnfg.unit_level%TYPE) IS
255: SELECT SUM(
256: get_earned_cp
257: (
258: sua.person_id,
347: l_course_version_number igs_en_stdnt_ps_att.version_number%TYPE;
348:
349: -- CURSOR to get the total unit level
350: CURSOR c_total_unt_lvl_cp (
351: cp_unit_level igs_pr_ul_mark_cnfg.unit_level%TYPE,
352: cp_course_cd igs_pr_ul_mark_cnfg.course_cd%TYPE,
353: cp_version_number igs_pr_ul_mark_cnfg.version_number%TYPE
354: )
355: IS
348:
349: -- CURSOR to get the total unit level
350: CURSOR c_total_unt_lvl_cp (
351: cp_unit_level igs_pr_ul_mark_cnfg.unit_level%TYPE,
352: cp_course_cd igs_pr_ul_mark_cnfg.course_cd%TYPE,
353: cp_version_number igs_pr_ul_mark_cnfg.version_number%TYPE
354: )
355: IS
356: SELECT total_unit_level_credits, mark_config_id, selection_method_code
349: -- CURSOR to get the total unit level
350: CURSOR c_total_unt_lvl_cp (
351: cp_unit_level igs_pr_ul_mark_cnfg.unit_level%TYPE,
352: cp_course_cd igs_pr_ul_mark_cnfg.course_cd%TYPE,
353: cp_version_number igs_pr_ul_mark_cnfg.version_number%TYPE
354: )
355: IS
356: SELECT total_unit_level_credits, mark_config_id, selection_method_code
357: FROM igs_pr_ul_mark_cnfg umc
353: cp_version_number igs_pr_ul_mark_cnfg.version_number%TYPE
354: )
355: IS
356: SELECT total_unit_level_credits, mark_config_id, selection_method_code
357: FROM igs_pr_ul_mark_cnfg umc
358: WHERE umc.unit_level = cp_unit_level
359: AND ( ( umc.course_cd = cp_course_cd
360: AND umc.version_number = cp_version_number
361: )
361: )
362: OR ( umc.course_cd IS NULL
363: AND umc.version_number IS NULL
364: AND NOT EXISTS ( SELECT 1
365: FROM igs_pr_ul_mark_cnfg umc_in
366: WHERE umc_in.unit_level = cp_unit_level
367: AND umc_in.course_cd = cp_course_cd
368: AND umc_in.version_number =
369: cp_version_number)
369: cp_version_number)
370: )
371: );
372:
373: l_mark_config_id igs_pr_ul_mark_cnfg.mark_config_id%TYPE;
374: l_selection_method_code igs_pr_ul_mark_cnfg.selection_method_code%TYPE;
375:
376: -- CURSOR to get the sum of earned cp in case total unit_level_credits is
377: -- not available from the set up table
370: )
371: );
372:
373: l_mark_config_id igs_pr_ul_mark_cnfg.mark_config_id%TYPE;
374: l_selection_method_code igs_pr_ul_mark_cnfg.selection_method_code%TYPE;
375:
376: -- CURSOR to get the sum of earned cp in case total unit_level_credits is
377: -- not available from the set up table
378: CURSOR c_total_unt_lvl_cp_alt (
375:
376: -- CURSOR to get the sum of earned cp in case total unit_level_credits is
377: -- not available from the set up table
378: CURSOR c_total_unt_lvl_cp_alt (
379: cp_unit_level igs_pr_ul_mark_cnfg.unit_level%TYPE,
380: cp_course_cd igs_pr_ul_mark_cnfg.course_cd%TYPE,
381: cp_person_id igs_en_su_attempt.person_id%TYPE,
382: cp_include VARCHAR2
383: )
376: -- CURSOR to get the sum of earned cp in case total unit_level_credits is
377: -- not available from the set up table
378: CURSOR c_total_unt_lvl_cp_alt (
379: cp_unit_level igs_pr_ul_mark_cnfg.unit_level%TYPE,
380: cp_course_cd igs_pr_ul_mark_cnfg.course_cd%TYPE,
381: cp_person_id igs_en_su_attempt.person_id%TYPE,
382: cp_include VARCHAR2
383: )
384: IS