Skip non-code tasks in adaptive course as too boring
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Wed, 3 Aug 2016 12:28:03 +0000 (15:28 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Wed, 3 Aug 2016 15:58:55 +0000 (18:58 +0300)
python/educational-core/student/src/com/jetbrains/edu/learning/stepic/EduAdaptiveStepicConnector.java

index 21d0c10863e3091149f64ccb8db40d3e1984faa1..65d12cda0ffe9ff32494893f036a6950a1566717 100644 (file)
@@ -99,6 +99,15 @@ public class EduAdaptiveStepicConnector {
               if (step.block.name.equals("code")) {
                 return getTaskFromStep(project, stepId, step.block, realLesson.getName());
               }
               if (step.block.name.equals("code")) {
                 return getTaskFromStep(project, stepId, step.block, realLesson.getName());
               }
+              else {
+                final StudyEditor editor = StudyUtils.getSelectedStudyEditor(project);
+                if (editor != null && editor.getTaskFile() != null) {
+                  final StepicUser user = StudyTaskManager.getInstance(project).getUser();
+                  postRecommendationReaction(project, String.valueOf(editor.getTaskFile().getTask().getLesson().getId()),
+                                             String.valueOf(user.getId()), -1);
+                  return getNextRecommendation(project, course);
+                }
+              }
             }
 
             LOG.warn("Got a lesson without code part as a recommendation");
             }
 
             LOG.warn("Got a lesson without code part as a recommendation");