1234567891011121314151617181920212223242526272829303132 |
- import { ref } from 'vue';
- import { GetShareConfig } from '@/api/app';
- export const questionColorList = [
- { label: '正确', color: '#D9D9D9' },
- { label: '错题', color: '#F2555A' },
- { label: '主观题', color: '#FEF2A4' }
- ];
- export function useExerciseTeacher() {
- let exercise_share_url_path = ref('');
- GetShareConfig().then(({ exercise_share_url_path: path }) => {
- exercise_share_url_path.value = path;
- });
- /**
- * 跳转到答题页面
- * @param {string} exercise_share_record_id 分享记录id
- * @param {string} exercise_answer_record_id 答题记录id
- * @param {number} index 题目索引
- */
- function exerciseLink(exercise_share_record_id, exercise_answer_record_id, index) {
- window.open(
- `${exercise_share_url_path.value}?share_record_id=${exercise_share_record_id}&answer_record_id=${exercise_answer_record_id}&question_index=${index}`,
- '_blank'
- );
- }
- return {
- exerciseLink
- };
- }
|