Model model = new Model("");
int[] duration = new int[]{1, 2, 1, 2, 3, 4, 1, 2};
int[] marks = new int[]{10, 5, 1, 5, 3, 4, 1, 2};
int targetDuration = 5;
IntVar[] questionSelectedOrNot = model.intVarArray("a", 8, 0, 1);
model.scalar(questionSelectedOrNot, duration, "=", targetDuration).post();
//Add a new constraint to model
// scalar product of questionSelectedOrNot and marks is a multiple of 10
if (model.getSolver().solve()) {
System.out.println(questionSelectedOrNot);
}