Category % in Parent Portal

We are looking to show the % of a category (for example 83% of HW, 75% of tests, etc) in the parent portal.

Since it appears in PT Gradebook in Final Scores Mode, we were wondering if anyone had any ideas of a customization that would make this possible?

Thanks!

Here is the SQL code to retrieve the category percent for a student- if you are running it from sql, replace the ~(curschoolid) and ~(curstudid) with your school's id and a studentid:

Select lastfirst, category, Case when Sum(case when storecode = 'Q1' and exempt = 0 then pointspossible*weight else 0 end) = 0 then 0 else
Round(Sum(case when storecode = 'Q1' then score*weight else 0 end)/Sum(case when storecode = 'Q1' and exempt = 0 then pointspossible*weight
else 0 end)*100,2) end as Q1Percent, Case when Sum(case when storecode = 'Q2' and exempt = 0 then pointspossible*weight else 0 end) = 0 then 0 else
Round(Sum(case when storecode = 'Q2' then score*weight else 0 end)/Sum(case when storecode = 'Q2' and exempt = 0 then pointspossible*weight
else 0 end)*100,2) end as Q2Percent, Case when Sum(case when storecode = 'S1' and exempt = 0 then pointspossible*weight else 0 end) = 0 then 0 else
Round(Sum(case when storecode = 'S1' then score*weight else 0 end)/Sum(case when storecode = 'S1' and exempt = 0 then pointspossible*weight
else 0 end)*100,2) end as S1Percent
from
(Select f.lastfirst, c.name as category, a.Score, a.exempt,b.pointspossible, e.storecode, b.weight
from (select FDCID,Assignment, Case when score is null then 0 when score ='--' then 0 when LENGTH(TRIM(TRANSLATE(score, ' +-.0123456789', ' '))) is null then to_number(score) else 0 end as Score,
Case when LENGTH(TRIM(TRANSLATE(score, ' +-.0123456789', ' '))) is null then 0 when exempt is null then 1 else 1 end as exempt
from SectionScoresAssignments) a
left outer join PGAssignments b on a.Assignment = b.iD
left outer join PGCategories c on b.PGcategoriesID = c.ID
left outer join SectionScoresID d on a.FDCID = d.DCID
left outer join TermBins e on b.datedue>= e.date1 and b.datedue<=e.date2 and e.schoolID= ~(curschoolid)
left outer join Students f on d.studentID = f.id
where d.termID>=2300 and d.studentID = ~(curstudid))
group by lastfirst,Category
order by lastfirst, category

Here is the correct code- the previous sql code I posted had errors- as before, if you are running it directly on sql, replace the ~(curschoolid) and ~(curstudid) with the correct values:

Select lastfirst, Course_name, Section_number, category, Case when Sum(case when storecode = 'Q1' and exempt = 0 then pointspossible*weight else 0 end) = 0 then 0 else
Round(Sum(case when storecode = 'Q1' then score*weight else 0 end)/Sum(case when storecode = 'Q1' and exempt = 0 then pointspossible*weight
else 0 end)*100,2) end as Q1Percent, Case when Sum(case when storecode = 'Q2' and exempt = 0 then pointspossible*weight else 0 end) = 0 then 0 else
Round(Sum(case when storecode = 'Q2' then score*weight else 0 end)/Sum(case when storecode = 'Q2' and exempt = 0 then pointspossible*weight
else 0 end)*100,2) end as Q2Percent, Case when Sum(case when storecode = 'S1' and exempt = 0 then pointspossible*weight else 0 end) = 0 then 0 else
Round(Sum(case when storecode = 'S1' then score*weight else 0 end)/Sum(case when storecode = 'S1' and exempt = 0 then pointspossible*weight
else 0 end)*100,2) end as S1Percent
from
(Select f.lastfirst,h.Course_name, g.Section_number, c.name as category, a.Score, a.exempt,b.pointspossible, e.storecode, b.weight
from (select FDCID,Assignment, Case when score is null then 0 when score ='--' then 0 when LENGTH(TRIM(TRANSLATE(score, ' +-.0123456789', ' '))) is null then to_number(score) else 0 end as Score,
Case when LENGTH(TRIM(TRANSLATE(score, ' +-.0123456789', ' '))) is null then 0 when exempt is null then 1 else 1 end as exempt
from SectionScoresAssignments) a
left outer join PGAssignments b on a.Assignment = b.iD
left outer join PGCategories c on b.PGcategoriesID = c.ID
left outer join SectionScoresID d on a.FDCID = d.DCID
left outer join TermBins e on b.datedue>= e.date1 and b.datedue<=e.date2 and e.schoolID= ~(curschoolID)
left outer join Students f on d.studentID = f.id
left outer join sections g on b.sectionID = g.ID
left outer join courses h on g.Course_number = h.course_number
where g.termID>=2300 and d.studentID = ~(curstudID))
group by lastfirst,course_name,Section_number, Category
order by lastfirst, course_name,Section_number, category

@admin- could you please delete my previous posts on this? I just noticed that I had specific values for ~(curschoolid) and ~(curstudid).
I have uploaded the correct SQL code to :
https://drive.google.com/file/d/0B5ugBSNgiHCjaXE4VEkzd25kZEU/edit?usp=sh...

Where are you putting this code in PP?

Kevin G. Harrison
Data Manager
Bedford County Public Schools

Subscribe to Comments for "Category % in Parent Portal"