forked from github/server
Merge pull request #811 from ennorehling/master
Fix crash in report 1095
This commit is contained in:
commit
a9c653c567
|
@ -81,13 +81,13 @@ void autostudy_run(scholar scholars[], int nscholars)
|
||||||
int mint;
|
int mint;
|
||||||
ts += scholars[se].u->number; /* count total scholars */
|
ts += scholars[se].u->number; /* count total scholars */
|
||||||
mint = (ts + 10) / 11; /* need a minimum of ceil(ts/11) teachers */
|
mint = (ts + 10) / 11; /* need a minimum of ceil(ts/11) teachers */
|
||||||
for (; mint > tt && si != nscholars; ++si) {
|
for (; mint > tt && si != nscholars && scholars[si].sk == sk; ++si) {
|
||||||
tt += scholars[si].u->number;
|
tt += scholars[si].u->number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* now si splits the teachers and students 1:10 */
|
/* now si splits the teachers and students 1:10 */
|
||||||
/* first student must be 2 levels below first teacher: */
|
/* first student must be 2 levels below first teacher: */
|
||||||
for (; si != se && scholars[ti].level - TEACHDIFFERENCE > scholars[si].level; ++si) {
|
for (; si != se && scholars[ti].level - TEACHDIFFERENCE > scholars[si].level && scholars[si].sk == sk; ++si) {
|
||||||
tt += scholars[si].u->number;
|
tt += scholars[si].u->number;
|
||||||
}
|
}
|
||||||
if (si == se) {
|
if (si == se) {
|
||||||
|
@ -134,7 +134,7 @@ void autostudy_run(scholar scholars[], int nscholars)
|
||||||
learning(scholars + s, (n - i));
|
learning(scholars + s, (n - i));
|
||||||
i = 0;
|
i = 0;
|
||||||
if (++s == se) {
|
if (++s == se) {
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
n = scholars[s].u->number;
|
n = scholars[s].u->number;
|
||||||
} while (scholars[t].level - TEACHDIFFERENCE < scholars[s].level);
|
} while (scholars[t].level - TEACHDIFFERENCE < scholars[s].level);
|
||||||
|
|
Loading…
Reference in New Issue