\documentclass[norsk,a4paper]{article}

\usepackage[utf8x]{inputenc}    
%\usepackage[latin1]{inputenc}    
\usepackage[T1]{fontenc}
\usepackage{multicol}
\usepackage{tabularx}
\usepackage{pgffor}
%\usepackage{babel}
\usepackage{pifont}
\usepackage{xcolor}
\usepackage[postcorrect, lang=NO, insidebox, noshuffle]{automultiplechoice}    

\newcommand\twodigits[1]{%
   \ifnum#1<10 0#1\else #1\fi
}

\definecolor{weak}{rgb}{1,0.001,0.001}
%\definecolor{weak}{gray}{0.7}

\def\NoOfQuestions{40}
\def\StudentNoOfDigits{4}

\def\SubjectCode{ 
	{\def\AMCbeginQuestion##1##2{}
		\AMCnobloc\setlength{\parindent}{0pt}
		\def\AMCbeginAnswer{\hspace{0pt}\vbox\bgroup}
		\def\AMCendAnswer{\vspace{-\AMCcodeVspace}\egroup}
		\def\AMCanswer##1##2{\hbox{##1 ##2}\vspace{\AMCcodeVspace}}
		\begin{question}{subject}\QuestionIndicative
			\begin{choicescustom}[o]\scoring{auto=1}
				\wrongchoice[\phantom{1}]{ING100}
				\wrongchoice[\phantom{2}]{ING110}
				\wrongchoice[\phantom{3}]{ING110 (Y-vei)}
				\wrongchoice[\phantom{4}]{ING120}
				\wrongchoice[\phantom{5}]{ING130}
				\wrongchoice[\phantom{6}]{ING140}
				\wrongchoice[\phantom{7}]{BID260}
				\end{choicescustom}
			\end{question}  }
	}

\AMCtext{draft}{U T K A S T}
\AMCtext{qf}{Oppgave }
\AMCtext{q}{ }
\AMCboxDimensions{size=3.0ex,down=.7ex}
\AMCboxColor{weak}
\def\AMCchoiceLabel#1{\alph{#1}} 
\AMCformBegin

\begin{document}
	\examcopy{800}{
		\begin{minipage}{1\linewidth} 	%%% test sheet header

			\begin{center}\large\bf
				Svarark til eksamen i \\ 
				ING100/ING110/ING120/ING130/ING140/BID260 \\  {\em \LARGE
				Ingeni{\o}rfaglig innf{\o}ringsemne \\ } 
			\end{center} 
			\end{minipage}
			\vspace{1mm}
			\begin{flushleft}\em
				Svararket skal leses maskinelt. 
				Sett et tydelig kryss \ding{56} i rutene med sort eller bl{\aa} kulepenn. 
				Skriver du feil m{\aa} du fylle ut et nytt svarark. 
				Klussing og overstrykning vil gi deg feilregistrerte svar. 
			\end{flushleft}

			{\setlength{\parindent}{0pt}
	

				\begin{tabularx}{\textwidth}{X|c|c}
				\hline 
				\em Skriv ditt kandidatnummer (\StudentNoOfDigits \ siffer) i boksen\em 
				& 
				\em Kode ditt kandidatnummer \em
				&
				\em Kryss av for hvilket emne du f{\o}lger \em
				\\
				 {
					\namefield{
						\fbox{    
						\begin{minipage}[b]{.9\linewidth}
							\color{weak}{Kandidatnummer}
							\vspace*{.50in}
							\end{minipage}
						}}
						} 

				& {
					\AMCcode{StudNo}{\StudentNoOfDigits}
					}
				& 
				{
				 \SubjectCode
								
						} \\ 
					\hline
				\end{tabularx} 


		}	%%% end of test sheet header

		\vspace{2mm}
				
		\em \center{Oppgavebesvarelser} \em 
		\begin{multicols}{4}\columnseprule=.4pt
		%\newcounter{n}
			\foreach \n in {1,...,{\NoOfQuestions}}{
				\begin{question}{\twodigits{\n}}
					\begin{choicescustom}
						\wrongchoice{}
						\wrongchoice{}
						\wrongchoice{}
						\wrongchoice{}
					\end{choicescustom}
				\end{question}
				\vspace{5.0mm}
			}
		\end{multicols}

	\AMCformS
}
\end{document}
