McExam 패키지로 첫 번째(2개) 질문 수정

McExam 패키지로 첫 번째(2개) 질문 수정

여러 버전의 McExam 패키지를 사용하여 McExam을 작성하고 있습니다. 처음 두 질문은 읽어야합니다

\documentclass{article}
\usepackage{mcexam}
\begin{document}
    \begin{mcquestions}

    %%%% Header questions (not be included in randomization) %%%

    \question What is the version of your question booklet?
    \begin{mcanswerslist}
        \answer[correct] Version A
        \answer Version B
    \end{mcanswerslist}

    \question Your exam will be graded only if you write your version on top of the bubble
    sheet provided. Did you write the version number on top of the bubble sheet?
    \begin{mcanswerslist}
        \answer[correct] Yes, I have written the version number on top of the bubble sheet.
        \answer No, I have not yet written the version number on top of the bubble sheet.
    \end{mcanswerslist}

    %%%% Main test questions (starting with #3, included in randomization) %%%       

    \question What is 5 + 2?
    \begin{mcanswerslist}
        \answer[correct] 7
        \answer 5
        \answer 3   
    \end{mcanswerslist}

    \question What is 1 + 3?
    \begin{mcanswerslist}
        \answer[correct] 4
        \answer 6
        \answer 2   
    \end{mcanswerslist}
    \end{mcquestions}

\end{document}

두 시험 버전 모두 헤더 질문은 질문 #1과 질문 #2로 되어 ​​있습니다.

그러나 무작위 추출에서 이 두 질문을 제외하는 방법을 알 수 없습니다.

[follow] 옵션을 사용해 보았으나 패키지에서 첫 번째 질문에 follow 옵션을 허용하지 않습니다.

또한 무작위 추출에서 처음 두 질문을 제외하거나 [fixposition] 옵션을 도입하기 위해 mcexam.sty 패키지를 조정해 보았습니다. 처음 두 질문은 항상 질문 1과 2가 되도록 관리했지만 무작위화에서는 다른 질문도 #1과 #2로 할당하고 의도한 질문 1과 2를 덮어씁니다.

또한 mcquestion 환경을 시작하기 전에 두 가지 질문을 포함하려고 했지만 mcquestion 환경에 3에서 카운터를 시작하도록 지시하는 방법을 알 수 없었습니다. \setcounter를 사용해 보았지만 어떤 카운터를 설정할지 알 수 없었습니다.

마지막으로 mcquestion 환경의 두 섹션만 사용하려고 했지만 두 번째 환경에서는 카운터가 1로 재설정되었습니다.

어떤 생각이나 제안이 있으십니까?

답변1

.sty 파일을 가지고 놀다가 작동하는 것을 감았습니다.

.sty 파일의 섹션 3.1에서는 질문이 무작위로 지정됩니다. 원래 코드의 978~1007행을 다음으로 대체했습니다.

\def\mc@randomizeQuestions{{    
  % Make the mcquestionblock control sequences which include macro's to set the randomization question counters 
  % exclude first two questions from randomization by setting counter to 2 and assigning the first two questions the first two numbers
  \setcounter{mc@counter}{2}
  \foreach \v in {1,...,\mc@totalNumberOfVersions}{
    \foreach \q in {1,...,2}{
      \csxdef{mc@randomQuestionNumberV\v Q\q}{\q}
      \csxdef{mc@originalQuestionNumberV\v Q\q}{\q} 
       }
    }   % For the randomization start at question q=3
  \foreach \q in {3,...,\mc@totalNumberOfQuestions}{
    \ifcsstring{mc@questionOption\q}{follow}{}{
      \refstepcounter{mc@counter}
      \csgdef{mc@questionblock\arabic{mc@counter}}{}
      }
    \csxappto{mc@questionblock\arabic{mc@counter}}{
      \noexpand\refstepcounter{mc@counter}
      \noexpand\csxdef{mc@randomQuestionNumberV\noexpand\v Q\q}{\noexpand\arabic{mc@counter}}
      \noexpand\csxdef{mc@originalQuestionNumberV\noexpand\v Q\noexpand\arabic{mc@counter}}{\q}        
      }  
    }
  % randomize question blocks
  \numdef\@numberofswaps{\mc@totalNumberOfQuestionblocks-1}
  \foreach \v in {1,...,\mc@totalNumberOfVersions}{
    \foreach \q in {1,...,\@numberofswaps}{
      \pgfmathrandominteger{\r}{\q}{\@numberofswaps}
      \numdef\r{\r+1}
      \global\letcs\@swap{mc@questionblock\r}
      \global\csletcs{mc@questionblock\r}{mc@questionblock\q}  
      \global\cslet{mc@questionblock\q}{\@swap}
      } % For the randomization  question block 2
    \setcounter{mc@counter}{2}  
    \foreach \q in {1,...,\mc@totalNumberOfQuestionblocks}{  
      \csuse{mc@questionblock\q}
      }
    }  
  }}

이것은 다음과 같이 작동했습니다.

  • 처음 두 질문에 1번과 2번을 할당하고,
  • 무작위화에서 mc@counter와 시작 카운터를 각각 증가시킵니다.

모든 MC 시험의 헤더 질문과 똑같은 두 가지 질문이 있기 때문에 이것이 나에게 효과적입니다.

그러나 이는 매우 우아한 솔루션이 아니므로 여전히 더 나은 솔루션에 관심이 있습니다.

관련 정보