diff --git a/python/educational-core/student/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java b/python/educational-core/student/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java index 7f8a01b3cec7..fa5d05fdc558 100644 --- a/python/educational-core/student/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java +++ b/python/educational-core/student/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java @@ -90,14 +90,14 @@ public class StudyProjectGenerator { protected Course getCourse(@NotNull final Project project) { final File courseFile = new File(new File(OUR_COURSES_DIR, mySelectedCourseInfo.getName()), EduNames.COURSE_META_FILE); if (courseFile.exists()) { - return readCourseFromCache(courseFile); + return readCourseFromCache(courseFile, false); } else { final File adaptiveCourseFile = new File(new File(OUR_COURSES_DIR, ADAPTIVE_COURSE_PREFIX + mySelectedCourseInfo.getName() + "_" + myUser.getEmail()), EduNames.COURSE_META_FILE); if (adaptiveCourseFile.exists()) { - return readCourseFromCache(adaptiveCourseFile); + return readCourseFromCache(adaptiveCourseFile, true); } } @@ -110,13 +110,13 @@ public class StudyProjectGenerator { } @Nullable - private static Course readCourseFromCache(File courseFile) { + private static Course readCourseFromCache(@NotNull File courseFile, boolean isAdaptive) { Reader reader = null; try { reader = new InputStreamReader(new FileInputStream(courseFile), "UTF-8"); Gson gson = new GsonBuilder().create(); final Course course = gson.fromJson(reader, Course.class); - course.initCourse(true); + course.initCourse(isAdaptive); return course; } catch (UnsupportedEncodingException e) { diff --git a/python/educational-python/resources/fileTemplates/internal/test_helper.py.ft b/python/educational-python/resources/fileTemplates/internal/test_helper.py.ft index c31d2fa2ed7c..8d3dcab08947 100644 --- a/python/educational-python/resources/fileTemplates/internal/test_helper.py.ft +++ b/python/educational-python/resources/fileTemplates/internal/test_helper.py.ft @@ -218,7 +218,7 @@ def check_samples(samples=()): passed() -def run_common_tests(): +def run_common_tests(error_text="Please, reload file and try again"): test_is_initial_text() test_is_not_empty() test_answer_placeholders_text_deleted()