Перейти к основному содержимому

Пример — получение оценки конкретного теста

Код алгоритма​

function getTemplateAppraisal(templateNumber) {
for (var index = 0; index < testingInfo.getTemplates().size(); index++) {
if (templateNumber == testingInfo.getTemplates().get(index).getPosition()) {
return testingInfo.getTemplates().get(index).getAppraisal();
}
}
throw 'Шаблон с номером ' + templateNumber + ' не найден';
}