Skip to content
Snippets Groups Projects
Commit e0f908b6 authored by uhensler's avatar uhensler
Browse files

OO-4752: More columns in list of question bank

parent 1f1da941
No related branches found
No related tags found
No related merge requests found
......@@ -199,6 +199,7 @@ public abstract class AbstractItemListController extends FormBasicController
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.taxonomyLevel));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.taxonomyPath));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.educationalContext));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.difficulty));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.stdevDifficulty));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.differentiation));
......@@ -206,6 +207,7 @@ public abstract class AbstractItemListController extends FormBasicController
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.usage));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.correctionTime));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.type));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.learningTime, new LearningTimeRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.format));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.rating));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.numberOfRatings));
......
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.modules.qpool.ui;
import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiCellRenderer;
import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableComponent;
import org.olat.core.gui.render.Renderer;
import org.olat.core.gui.render.StringOutput;
import org.olat.core.gui.render.URLBuilder;
import org.olat.core.gui.translator.Translator;
import org.olat.modules.qpool.manager.MetadataConverterHelper;
import org.olat.modules.qpool.model.LOMDuration;
/**
*
* Initial date: 7 Sep 2020<br>
* @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
*
*/
public class LearningTimeRenderer implements FlexiCellRenderer {
@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source,
URLBuilder ubu, Translator translator) {
if (cellValue instanceof String) {
LOMDuration duration = MetadataConverterHelper.convertDuration((String)cellValue);
target.append(duration.getDay()).append(translator.translate("educational.learningTime.day")).append(" ");
target.append(duration.getHour()).append(translator.translate("educational.learningTime.hour")).append(" ");
target.append(duration.getMinute()).append(translator.translate("educational.learningTime.minute")).append(" ");
target.append(duration.getSeconds()).append(translator.translate("educational.learningTime.second"));
}
}
}
......@@ -90,6 +90,7 @@ public class QuestionItemDataModel extends DefaultFlexiTableDataSourceModel<Item
case lastModified: return item.getLastModified();
case taxonomyLevel: return item.getTaxonomyLevelName();
case taxonomyPath: return item.getTaxonomicPath();
case educationalContext: return item.getEducationalContextLevel();
case difficulty: return MetaUIFactory.bigDToString(item.getDifficulty());
case stdevDifficulty: return MetaUIFactory.bigDToString(item.getStdevDifficulty());
case differentiation: return MetaUIFactory.bigDToString(item.getDifferentiation());
......@@ -105,6 +106,7 @@ public class QuestionItemDataModel extends DefaultFlexiTableDataSourceModel<Item
}
return type;
}
case learningTime: return item.getEducationalLearningTime();
case rating: return round(item.getRating());
case numberOfRatings: return item.getNumberOfRatings();
case format: return item.getFormat();
......@@ -136,11 +138,13 @@ public class QuestionItemDataModel extends DefaultFlexiTableDataSourceModel<Item
lastModified("technical.lastModified"),
taxonomyLevel("classification.taxonomy.level"),
taxonomyPath("classification.taxonomic.path"),
educationalContext("educational.context"),
difficulty("question.difficulty"),
stdevDifficulty("question.stdevDifficulty"),
differentiation("question.differentiation"),
numOfAnswerAlternatives("question.numOfAnswerAlternatives"),
usage("question.usage"),
learningTime("educational.learningTime"),
type("question.type"),
format("technical.format"),
rating("rating"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment