fix: diverse kleine bugs
Bij het zoeken van leerpaden en het renderen van leerobjecten.
This commit is contained in:
		
							parent
							
								
									a803b45046
								
							
						
					
					
						commit
						6d452c7f72
					
				
					 10 changed files with 20 additions and 29 deletions
				
			
		|  | @ -14,7 +14,7 @@ export class MultipleChoiceQuestionRenderer extends GIFTQuestionRenderer<Multipl | ||||||
|         for (const choice of question.choices) { |         for (const choice of question.choices) { | ||||||
|             renderedHtml += `<div class="gift-choice-div">\n`; |             renderedHtml += `<div class="gift-choice-div">\n`; | ||||||
|             renderedHtml += `    <input type='radio' id='gift-q${questionNumber}-choice-${i}' name='gift-q${questionNumber}-choices' value="${i}"/>\n`; |             renderedHtml += `    <input type='radio' id='gift-q${questionNumber}-choice-${i}' name='gift-q${questionNumber}-choices' value="${i}"/>\n`; | ||||||
|             renderedHtml += `    <label for='gift-q${questionNumber}-choice-${i}'>${choice.text}</label>\n`; |             renderedHtml += `    <label for='gift-q${questionNumber}-choice-${i}'>${choice.text.text}</label>\n`; | ||||||
|             renderedHtml += `</div>\n`; |             renderedHtml += `</div>\n`; | ||||||
|             i++; |             i++; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -1,2 +1,2 @@ | ||||||
| ::MC basic:: | ::Reflection:: | ||||||
| Reflect on this learning path. What have you learned today? {} | Reflect on this learning path. What have you learned today? {} | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| <div class="learning-object-gift"> | <div class="learning-object-gift"> | ||||||
|     <div id="gift-q1" class="gift-question"> |     <div id="gift-q1" class="gift-question"> | ||||||
|         <h2 id="gift-q1-title" class="gift-title">MC basic</h2> |         <h2 id="gift-q1-title" class="gift-title">Reflection</h2> | ||||||
|         <p id="gift-q1-stem" class="gift-stem">Reflect on this learning path. What have you learned today?</p> |         <p id="gift-q1-stem" class="gift-stem">Reflect on this learning path. What have you learned today?</p> | ||||||
|         <textarea id="gift-q1-answer" class="gift-essay-answer"></textarea> |         <textarea id="gift-q1-answer" class="gift-essay-answer"></textarea> | ||||||
|     </div> |     </div> | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| ::MC basic:: | ::Self-evaluation:: | ||||||
| Are you following along well?  { | Are you following along well?  { | ||||||
| 	~No, it's very difficult to follow along. | 	~No, it's very difficult to follow along. | ||||||
|     =Yes, no problem! |     =Yes, no problem! | ||||||
|  |  | ||||||
|  | @ -1,14 +1,14 @@ | ||||||
| <div class="learning-object-gift"> | <div class="learning-object-gift"> | ||||||
|     <div id="gift-q1" class="gift-question"> |     <div id="gift-q1" class="gift-question"> | ||||||
|         <h2 id="gift-q1-title" class="gift-title">MC basic</h2> |         <h2 id="gift-q1-title" class="gift-title">Self-evaluation</h2> | ||||||
|         <p id="gift-q1-stem" class="gift-stem">Are you following along well?</p> |         <p id="gift-q1-stem" class="gift-stem">Are you following along well?</p> | ||||||
|         <div class="gift-choice-div"> |         <div class="gift-choice-div"> | ||||||
|             <input value="0" name="gift-q1-choices" id="gift-q1-choice-0" type="radio"> |             <input value="0" name="gift-q1-choices" id="gift-q1-choice-0" type="radio"> | ||||||
|             <label for="gift-q1-choice-0">[object Object]</label> |             <label for="gift-q1-choice-0">No, it's very difficult to follow along.</label> | ||||||
|         </div> |         </div> | ||||||
|         <div class="gift-choice-div"> |         <div class="gift-choice-div"> | ||||||
|             <input value="1" name="gift-q1-choices" id="gift-q1-choice-1" type="radio"> |             <input value="1" name="gift-q1-choices" id="gift-q1-choice-1" type="radio"> | ||||||
|             <label for="gift-q1-choice-1">[object Object]</label> |             <label for="gift-q1-choice-1">Yes, no problem!</label> | ||||||
|         </div> |         </div> | ||||||
|     </div> |     </div> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ const nowString = new Date().toString(); | ||||||
| export const testLearningPath01: LearningPathDTO = { | export const testLearningPath01: LearningPathDTO = { | ||||||
|     keywords: "test", |     keywords: "test", | ||||||
|     target_ages: [16, 17, 18], |     target_ages: [16, 17, 18], | ||||||
|     hruid: "id01", |     hruid: `${getEnvVar(envVars.UserContentPrefix)}id01`, | ||||||
|     language: Language.English, |     language: Language.English, | ||||||
|     title: "repertoire Tool", |     title: "repertoire Tool", | ||||||
|     description: "all about Tool", |     description: "all about Tool", | ||||||
|  | @ -67,7 +67,7 @@ export const testLearningPath01: LearningPathDTO = { | ||||||
| export const testLearningPath02: LearningPathDTO = { | export const testLearningPath02: LearningPathDTO = { | ||||||
|     keywords: "test", |     keywords: "test", | ||||||
|     target_ages: [16, 17, 18], |     target_ages: [16, 17, 18], | ||||||
|     hruid: "id02", |     hruid: `${getEnvVar(envVars.UserContentPrefix)}id02`, | ||||||
|     language: Language.English, |     language: Language.English, | ||||||
|     title: "repertoire Dire Straits", |     title: "repertoire Dire Straits", | ||||||
|     description: "all about Dire Straits", |     description: "all about Dire Straits", | ||||||
|  |  | ||||||
|  | @ -51,22 +51,11 @@ export async function seedDatabase(): Promise<void> { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     // Persist all entities
 |     // Persist all entities
 | ||||||
|     /*await em.persistAndFlush([ |     await em.persistAndFlush([ | ||||||
|         ...students, |         ...students, | ||||||
|         ...teachers, |         ...teachers, | ||||||
|         ...learningObjects, |         ...learningObjects, | ||||||
|     ]);*/ |         ...learningPaths, | ||||||
| 
 |  | ||||||
|     try { |  | ||||||
|         await em.persistAndFlush(learningPaths[0]); |  | ||||||
|     } catch (e) { |  | ||||||
|         "hey"; |  | ||||||
|     } |  | ||||||
|     /*await em.persistAndFlush(learningPaths[1]); |  | ||||||
|     await em.persistAndFlush(learningPaths[2]); |  | ||||||
|     await em.persistAndFlush(learningPaths[3]); |  | ||||||
| 
 |  | ||||||
|     await em.persistAndFlush([ |  | ||||||
|         ...classes, |         ...classes, | ||||||
|         ...assignments, |         ...assignments, | ||||||
|         ...groups, |         ...groups, | ||||||
|  | @ -76,7 +65,7 @@ export async function seedDatabase(): Promise<void> { | ||||||
|         ...questions, |         ...questions, | ||||||
|         ...answers, |         ...answers, | ||||||
|         ...submissions, |         ...submissions, | ||||||
|     ])*/ |     ]); | ||||||
| 
 | 
 | ||||||
|     logger.info('Development database seeded successfully!'); |     logger.info('Development database seeded successfully!'); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -8,8 +8,8 @@ export class LearningPathController extends BaseController { | ||||||
|     constructor() { |     constructor() { | ||||||
|         super("learningPath"); |         super("learningPath"); | ||||||
|     } |     } | ||||||
|     async search(query: string): Promise<LearningPath[]> { |     async search(query: string, language: string): Promise<LearningPath[]> { | ||||||
|         const dtos = await this.get<LearningPathDTO[]>("/", { search: query }); |         const dtos = await this.get<LearningPathDTO[]>("/", { search: query, language }); | ||||||
|         return dtos.map((dto) => LearningPath.fromDTO(dto)); |         return dtos.map((dto) => LearningPath.fromDTO(dto)); | ||||||
|     } |     } | ||||||
|     async getBy( |     async getBy( | ||||||
|  |  | ||||||
|  | @ -34,12 +34,14 @@ export function useGetAllLearningPathsByThemeQuery( | ||||||
| 
 | 
 | ||||||
| export function useSearchLearningPathQuery( | export function useSearchLearningPathQuery( | ||||||
|     query: MaybeRefOrGetter<string | undefined>, |     query: MaybeRefOrGetter<string | undefined>, | ||||||
|  |     language: MaybeRefOrGetter<string | undefined> | ||||||
| ): UseQueryReturnType<LearningPath[], Error> { | ): UseQueryReturnType<LearningPath[], Error> { | ||||||
|     return useQuery({ |     return useQuery({ | ||||||
|         queryKey: [LEARNING_PATH_KEY, "search", query], |         queryKey: [LEARNING_PATH_KEY, "search", query, language], | ||||||
|         queryFn: async () => { |         queryFn: async () => { | ||||||
|             const queryVal = toValue(query)!; |             const queryVal = toValue(query)!; | ||||||
|             return learningPathController.search(queryVal); |             const languageVal = toValue(language)!; | ||||||
|  |             return learningPathController.search(queryVal, languageVal); | ||||||
|         }, |         }, | ||||||
|         enabled: () => Boolean(toValue(query)), |         enabled: () => Boolean(toValue(query)), | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  | @ -9,11 +9,11 @@ | ||||||
|     import LearningPathsGrid from "@/components/LearningPathsGrid.vue"; |     import LearningPathsGrid from "@/components/LearningPathsGrid.vue"; | ||||||
| 
 | 
 | ||||||
|     const route = useRoute(); |     const route = useRoute(); | ||||||
|     const { t } = useI18n(); |     const { t, locale } = useI18n(); | ||||||
| 
 | 
 | ||||||
|     const query = computed(() => route.query.query as string | undefined); |     const query = computed(() => route.query.query as string | undefined); | ||||||
| 
 | 
 | ||||||
|     const searchQueryResults = useSearchLearningPathQuery(query); |     const searchQueryResults = useSearchLearningPathQuery(query, locale); | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <template> | <template> | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger