use of org.olat.modules.coach.ui.ProgressValue in project OpenOLAT by OpenOLAT.
the class ProgressRenderer method render.
@Override
public void render(StringOutput sb, Renderer renderer, Object val, Locale locale, int alignment, String action) {
if (renderer == null) {
ProgressValue progress = (ProgressValue) val;
int green = progress.getGreen();
int total = progress.getTotal();
sb.append(green).append(" / ").append(total);
} else {
super.render(sb, renderer, val, locale, alignment, action);
}
}
use of org.olat.modules.coach.ui.ProgressValue in project OpenOLAT by OpenOLAT.
the class ProgressRenderer method getCellValue.
@Override
protected String getCellValue(Object val) {
StringBuilder sb = new StringBuilder();
if (val instanceof ProgressValue) {
ProgressValue progress = (ProgressValue) val;
int green = Math.round(100.0f * ((float) progress.getGreen() / (float) progress.getTotal()));
String[] values = new String[] { Integer.toString(progress.getGreen()), Integer.toString(progress.getTotal()) };
String tooltip = translator.translate("tooltip.of", values);
sb.append("<div class='progress' title='").append(tooltip).append("'>").append("<div class='progress-bar' role='progressbar' aria-valuenow='").append(progress.getGreen()).append("' aria-valuemin='0' aria-valuemax='").append(progress.getTotal()).append("' style='width: ").append(green).append("%;'/>").append("<span class='sr-only'>").append(green).append("%</span></div></div>");
/*
<div class="progress-bar" role="progressbar" aria-valuenow="${used}" aria-valuemin="0" aria-valuemax="100" style="width:${used};">
<span class="sr-only">${used}%</span>
</div>
*/
}
return sb.toString();
}
use of org.olat.modules.coach.ui.ProgressValue in project OpenOLAT by OpenOLAT.
the class GroupsTableDataModel method getValueAt.
@Override
public Object getValueAt(int row, int col) {
GroupStatEntry g = groups.get(row);
int numOfStudents = g.getCountStudents();
switch(Columns.getValueAt(col)) {
case name:
{
return g.getGroupName();
}
case countCourses:
{
return new Integer(g.getCountCourses());
}
case countStudents:
{
return new Integer(numOfStudents);
}
case initialLaunch:
{
int count = g.getCountCourses() * g.getCountStudents();
if (count == 0) {
return new LightedValue(null, Light.grey);
}
int launch = g.getInitialLaunch();
Light light = Light.yellow;
if (launch == count) {
light = Light.green;
} else if (launch == 0) {
light = Light.red;
}
return new LightedValue(launch, light);
}
case countPassed:
{
if (numOfStudents == 0) {
return numOfStudents;
}
ProgressValue val = new ProgressValue();
val.setTotal(numOfStudents);
val.setGreen(g.getCountPassed());
return val;
}
case countPassedLight:
{
if (numOfStudents == 0) {
return new LightedValue(null, Light.grey);
}
int passed = g.getCountPassed();
Light light = Light.yellow;
if (passed == numOfStudents) {
light = Light.green;
} else if (passed == 0) {
light = Light.red;
}
return new LightedValue(passed, light);
}
case averageScore:
return g.getAverageScore();
case statistics:
{
return g;
}
}
return null;
}
use of org.olat.modules.coach.ui.ProgressValue in project openolat by klemens.
the class ProgressRenderer method render.
@Override
public void render(StringOutput sb, Renderer renderer, Object val, Locale locale, int alignment, String action) {
if (renderer == null) {
ProgressValue progress = (ProgressValue) val;
int green = progress.getGreen();
int total = progress.getTotal();
sb.append(green).append(" / ").append(total);
} else {
super.render(sb, renderer, val, locale, alignment, action);
}
}
use of org.olat.modules.coach.ui.ProgressValue in project openolat by klemens.
the class GroupsTableDataModel method getValueAt.
@Override
public Object getValueAt(int row, int col) {
GroupStatEntry g = groups.get(row);
int numOfStudents = g.getCountStudents();
switch(Columns.getValueAt(col)) {
case name:
{
return g.getGroupName();
}
case countCourses:
{
return new Integer(g.getCountCourses());
}
case countStudents:
{
return new Integer(numOfStudents);
}
case initialLaunch:
{
int count = g.getCountCourses() * g.getCountStudents();
if (count == 0) {
return new LightedValue(null, Light.grey);
}
int launch = g.getInitialLaunch();
Light light = Light.yellow;
if (launch == count) {
light = Light.green;
} else if (launch == 0) {
light = Light.red;
}
return new LightedValue(launch, light);
}
case countPassed:
{
if (numOfStudents == 0) {
return numOfStudents;
}
ProgressValue val = new ProgressValue();
val.setTotal(numOfStudents);
val.setGreen(g.getCountPassed());
return val;
}
case countPassedLight:
{
if (numOfStudents == 0) {
return new LightedValue(null, Light.grey);
}
int passed = g.getCountPassed();
Light light = Light.yellow;
if (passed == numOfStudents) {
light = Light.green;
} else if (passed == 0) {
light = Light.red;
}
return new LightedValue(passed, light);
}
case averageScore:
return g.getAverageScore();
case statistics:
{
return g;
}
}
return null;
}
Aggregations