Skip to content

Commit

Permalink
Merge pull request #8424 from marcellamaki/channel-browse-and-search
Browse files Browse the repository at this point in the history
WIP: Strings with some feature dev for Channel browse and search
  • Loading branch information
rtibbles authored Sep 15, 2021
2 parents dc359f8 + 09c73ca commit 80369e5
Show file tree
Hide file tree
Showing 30 changed files with 1,953 additions and 509 deletions.
152 changes: 152 additions & 0 deletions kolibri/core/assets/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ export const ContentNodeKinds = {
BOOKMARK: 'bookmark',
};

// coach-facing
export const ContentNodeResourceType = {
LESSON: 'Lesson',
TUTORIAL: 'Tutorial',
ACTIVITY: 'Activity',
EXERCISE: 'Exercise',
MEDIA: 'Media',
BOOK: 'Book',
GAME: 'Game',
GUIDE: 'Guide',
TEXTBOOK: 'Textbook',
LESSON_PLAN: 'Lesson plan',
};

export const LearningActivities = {
CREATE: 'create',
LISTEN: 'listen',
Expand All @@ -41,6 +55,144 @@ export const LearningActivities = {
TOPIC: 'topic',
};

export const ContentKindsToLearningActivitiesMap = {
audio: LearningActivities.LISTEN,
document: LearningActivities.READ,
exercise: LearningActivities.PRACTICE,
html5: LearningActivities.EXPLORE,
video: LearningActivities.WATCH,
topic: 'folder',
};

// Resource library categories and subcategoriess
export const LibraryCategories = {
SCHOOL: 'school',
BASIC_SKILLS: 'basicSkills',
WORK: 'work',
DAILY_LIFE: 'dailyLife',
FOR_TEACHERS: 'forTeachers',
};

export const SchoolCategories = {
MATHEMATICS: 'mathematics',
SCIENCES: 'sciences',
LITERATURE: 'literature',
SOCIAL_SCIENCES: 'socialSciences',
ARTS: 'arts',
COMPUTER_SCIENCE: 'computerScience',
LANGUAGE_LEARNING: 'languageLearning',
HISTORY: 'history',
};

export const MathematicsSubcategories = {
ARITHMETIC: 'arithmetic',
ALGEBRA: 'algebra',
GEOMETRY: 'geometry',
CALCULUS: 'calculus',
STATISTICS: 'statistics',
};

export const SciencesSubcategories = {
BIOLOGY: 'biology',
CHEMISTRY: 'chemistry',
PHYSICS: 'physics',
EARTH_SCIENCE: 'earthScience',
ASTRONOMY: 'astronomy',
};

export const LiteratureSubcategories = {
LITERATURE: 'literature',
READING_COMPREHENSION: 'readingComprehension',
WRITING: 'writing',
LOGIC_AND_CRITICAL_THINKING: 'logicAndCriticalThinking',
};

export const SocialSciencesSubcategories = {
POLITICAL_SCIENCE: 'politicalScience',
SOCIOLOGY: 'sociology',
ANTHROPOLOGY: 'anthropology',
CIVIC_EDUCATION: 'civicEducation',
};

export const ArtsSubcategories = {
VISUAL_ART: 'visualArt',
MUSIC: 'music',
DANCE: 'dance',
DRAMA: 'drama',
};

export const ComputerScienceSubcategories = {
PROGRAMMING: 'programming',
MECHANICAL_ENGINEERING: 'mechanicalEngineering',
WEB_DESIGN: 'webDesign',
};

export const BasicSkillsCategories = {
LITERACY: 'literacy',
NUMERACY: 'numeracy',
DIGITAL_LITERACY: 'digitalLiteracy',
LOGIC_AND_CRITICAL_THINKING: 'logicAndCriticalThinking',
LEARNING_SKILLS: 'learningSkills',
};

export const WorkCategories = {
PROFESSIONAL_SKILLS: 'professionalSkills',
TECHNICAL_AND_VOCATIONAL_TRAINING: 'technicalAndVocationalTraining',
};

export const VocationalSubcategories = {
TOOLS_AND_SOFTWARE_TRAINING: 'toolsAndSoftwareTraining',
SKILLS_TRAINING: 'skillsTraining',
INDUSTRY_AND_SECTOR_SPECIFIC: 'industryAndSectorSpecific',
};

export const DailyLifeCategories = {
PUBLIC_HEALTH: 'publicHealth',
ENTREPRENEURSHIP: 'entrepreneurship',
FINANCIAL_LITERACY: 'financialLiteracy',
CURRENT_EVENTS: 'currentEvents',
ENVIRONMENT: 'environment',
MEDIA_LITERACY: 'mediaLiteracy',
DIVERSITY: 'diversity',
MENTAL_HEALTH: 'mentalHealth',
};

export const TeachersCategories = {
GUIDES: 'guides',
LESSON_PLANS: 'lessonPlans',
};

export const ResourcesNeededTypes = {
FOR_BEGINNERS: 'forBeginners',
TEACHERS_AND_PEERS: 'toUseWithTeachersAndPeers',
PAPER_AND_PENCIL: 'toUseWithPaperAndPencil',
NEEDS_INTERNET: 'needsInternet',
NEEDS_MATERIALS: 'needsMaterials',
};

export const AccessibilityCategories = {
ALL: 'all',
SIGN_LANGUAGE: 'signLanguage',
AUDIO_DESCRIPTION: 'audioDescription',
TAGGED_PDF: 'taggedPdf',
ALT_TEXT: 'altText',
HIGH_CONTRAST: 'highContrast',
CAPTIONS_SUBTITLES: 'captionsSubtitles',
};

// Used to categorize the level or audience of content
export const ContentLevels = {
PRESCHOOL: 'preschool',
LOWER_PRIMARY: 'lowerPrimary',
UPPER_PRIMARY: 'upperPrimary',
LOWER_SECONDARY: 'lowerSecondary',
UPPER_SECONDARY: 'upperSecondary',
TERTIARY: 'tertiary',
PROFESSIONAL: 'specializedProfessionalTraining',
BASIC_SKILLS: 'basicSkills',
WORK_SKILLS: 'workSkills',
};

// used internally on the client as a hack to allow content-icons to display users
export const USER = 'user';

Expand Down
158 changes: 153 additions & 5 deletions kolibri/core/assets/src/mixins/commonCoreStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ export const coreStrings = createTranslator('CommonCoreStrings', {
message: 'Save to bookmarks',
context: "An action that adds a resource or topic to a user's bookmarks",
},
viewInformation: {
message: 'View information',
context: 'Show more detailed information about a resource',
},

// labels, phrases, titles, headers...
adminLabel: {
Expand Down Expand Up @@ -178,6 +174,11 @@ export const coreStrings = createTranslator('CommonCoreStrings', {
context:
'Channels are collections of educational resources (video, audio, document files or interactive apps) prepared and organized by the channel curator for their use in Kolibri.\n\nA learner will see a set of channels available to them when they first open Kolibri.',
},
channelLabel: {
message: 'Channel',
context:
'Channels are collections of educational resources (video, audio, document files or interactive apps) prepared and organized by the channel curator for their use in Kolibri. A label for a single channel.',
},
classCoachLabel: {
message: 'Class coach',
context:
Expand Down Expand Up @@ -335,6 +336,10 @@ export const coreStrings = createTranslator('CommonCoreStrings', {
message: 'Search',
context: 'Test used to indicate the Kolibri search field.',
},
findSomethingToLearn: {
message: 'Find something to learn',
context: 'Suggestion located inside the the keyword search field.',
},
startSearchButtonLabel: {
message: 'Start search',
context: 'Refers to the search button used to initiate a search.',
Expand Down Expand Up @@ -383,6 +388,18 @@ export const coreStrings = createTranslator('CommonCoreStrings', {
context:
'This button appears in Kolibri to indicate to users that there are more results available when they search for resources, for example.',
},
copies: {
message: '{ num, number} locations',
context:
'Some Kolibri resources may be duplicated in different topics or channels.\n\nSearch results will indicate when a resource is duplicated, and learners can click on the "...locations" link to discover the details for each location.',
},
viewInformation: {
message: 'View information',
context: 'Show more detailed information about a resource',
},
moreOptions: {
message: 'More options',
},
userActionsColumnHeader: {
message: 'Actions',
context:
Expand All @@ -408,14 +425,137 @@ export const coreStrings = createTranslator('CommonCoreStrings', {
},

// Learning activities
allActivities: {
message: 'All',
context: 'Refers to all types of learning activities.',
},
createActivity: 'Create',
listenActivity: 'Listen',
reflectActivity: 'Reflect',
practiceActivity: 'Practice',
readActivity: 'Read',
watchActivity: 'Watch',
exploreActivity: 'Explore',
topicLabel: 'Topic',

// Library Categories
school: 'School',
basicSkills: 'Basic skills',
work: 'Work',
dailyLife: 'Daily life',
forTeachers: 'For teachers',

// School Categories
mathematics: 'Mathematics',
sciences: 'Sciences',
literature: 'Literature',
socialSciences: 'Social sciences',
arts: 'Arts',
computerScience: 'Computer science',
languageLearning: 'Language learning',
history: 'History',

// Mathematics Subcategories
arithmetic: 'Arithmetic',
algebra: 'Algebra',
geometry: 'Geometry',
calculus: 'Calculus',
statistics: 'Statistics',

// Sciences Subcategories
biology: 'Biology',
chemistry: 'Chemistry',
physics: 'Physics',
earthScience: 'Earth science',
astronomy: 'Astronomy',

// Literature Subcategories
readingComprehension: 'Reading comprehension',
writing: 'Writing',
logicAndCriticalThinking: 'Logic and critical thinking',

// Social Sciences Subcategories
politicalScience: 'Political science',
sociology: 'Sociology',
anthropology: 'Anthropology',
civicEducation: 'Civic education',

// Arts Subcategories = {
visualArt: 'Visual art',
music: 'Music',
dance: 'Dance',
drama: 'Drama',

// Computer Science Subcategories
programming: 'Programming',
mechanicalEngineering: 'Mechanical engineering',
webDesign: 'Web design',

// Basic Skills
literacy: 'Literacy',
numeracy: 'Numeracy',
digitialLiteracy: 'Digital literacy',
logicalAndCriticalThinking: 'Logic and critical thinking',
learningSkills: 'Learning skills',

// Work Categories
professionalSkills: 'Professional skills',
technicalAndVocationalTraining: 'Technical and vocational training',

// VocationalSubcategories
toolsAndSoftwareTraining: 'Tools and software training',
skillsTraining: 'Skills training',
industryAndSectorSpecific: 'Industry and sector specific',

// Daily Life Categories
publicHealth: 'Public health',
entrepreneurship: 'Entrepreneurship',
financialLiteracy: 'Financial literacy',
currentEvents: 'Current events',
environment: 'Environment',
mediaLiteracy: 'Media literacy',
diversity: 'Diversity',
mentalHealth: 'Mental health',

// Teacher-Specific Categories
guides: 'Guides',
lessonPlans: 'Lesson plans',

// Resources Needed Categories = {
ForBeginners: 'For beginners',
ToUseWithTeachersAndPeers: 'To use with teachers and peers',
ToUseWithPaperAndPencil: 'To use with paper and pencil',
NeedsInternet: 'That need internet connection',
NeedsMaterials: 'That need other materials',

// Accessibility category name
accessibility: {
message: 'Accessibility',
context:
'Allows the user to filter for all the resources with accessibility features for learners with disabilities.',
},
// Accessibility Categories
all: 'All',
signLanguage: 'Has sign language captions',
audioDescription: 'Has audio description',
taggedPdf: 'Tagged PDF',
altText: 'Has alternative text description for images',
highContrast: 'Has high contrast display for low vision',
captionsSubtitles: 'Has captions or subtitles',

// Used to categorize the level or audience of content
// ContentLevels
preschool: 'Preschool',
lowerPrimary: 'Lower primary',
upperPrimary: 'Upper primary',
lowerSecondary: 'Lower secondary',
upperSecondary: 'Upper secondary',
tertiary: 'Tertiary',
specializedProfessionalTraining: 'Specialized professional training',
allLevelsBasicSkills: 'All levels -- basic skills',
allLevelsWorkSkills: 'All levels -- work skills',

browseChannel: 'Browse Channel',
topicLabel: 'Folder',
readReference: {
message: 'Reference',
context:
Expand Down Expand Up @@ -527,6 +667,14 @@ export const coreStrings = createTranslator('CommonCoreStrings', {
message: 'Not started',
context: 'For content that has not been viewed or engaged with yet',
},
folder: {
message: 'Folder',
context: "Tab label in the 'Browse channel' page that allows to navigate through its topics.",
},
folders: {
message: 'Folders',
context: "Tab label in the 'Browse channel' page that allows to navigate through its topics.",
},
});

export default {
Expand Down
7 changes: 6 additions & 1 deletion kolibri/core/assets/src/validators.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import values from 'lodash/values';
import { ContentNodeKinds } from 'kolibri.coreVue.vuex.constants';
import { ContentNodeKinds, LearningActivities } from 'kolibri.coreVue.vuex.constants';
import every from 'lodash/every';
import keys from 'lodash/keys';

Expand All @@ -20,3 +20,8 @@ export function validateUsername(username) {
export function validateContentNodeKind(value, others = []) {
return [...values(ContentNodeKinds), ...others].includes(value);
}

export function validateLearningActivity(arr) {
const isValidLearningActivity = v => Object.values(LearningActivities).includes(v);
return arr.length > 0 && arr.every(isValidLearningActivity);
}
Loading

0 comments on commit 80369e5

Please sign in to comment.