I am creating a Graduation Plan Infopath form. I am having trouble coming up with an expression to calculate the credits earned.
Students earn credits by course in two semesters. This are the scenarios:
pass-pass
Passing the first semester, half of the credits are earned. Passing the second semester the other half of the credits are earned.
fail-pass
Failing the first semester, but passing the second semester full credit are earned.
pass-fail
Passing only the first semester, gives half of the credits.
fail-fail
Failing both semesters results on 0 credits earned.
Examples:
|
|
|
|
First Sem |
Second Sem |
|
|
|
Passing Gr |
Credits |
A |
Fall Credit |
B |
Spring Cr |
Accumulated
|
|
(Fall Gr) |
(Spring Gr) |
| pass-pass |
English I |
70% |
4 |
71% |
2 |
71% |
2 |
4 |
| fail-pass |
English I |
70% |
4 |
69% |
0 |
71% |
4 |
4 |
| pass-fail |
English I |
70% |
4 |
71% |
2 |
69% |
0 |
2 |
| fail-fail |
English I |
70% |
4 |
69% |
0 |
69% |
0 |
0 |
I created this on a section inside a repeating table. This is how the form looks like:

I was thinking on setting a default value on the 'fallCredit' and 'springCredit' fields using the eval function. Unfortunatley, I haven't been able to understand how to use XPath expressions.
Can you please help?