Skip to content

Commit

Permalink
fix bad conflicts resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
luclaurent committed Jan 5, 2025
1 parent 7b33ec7 commit c7fadf1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 71 deletions.
24 changes: 0 additions & 24 deletions amc2moodle/moodle2amc/_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,9 @@ def __init__(self, q):
self.svg_id = 0

def __repr__(self):
<<<<<<< HEAD
""" Change string representation.
"""
rep = (f"Instance of {self.__class__.__name__} containing the question '{self.name}'.")
=======
"""Change string representation."""
rep = ("Instance of {} containing the question '{}'."
.format(self.__class__.__name__, self.name))
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76
return rep

def __str__(self):
Expand Down Expand Up @@ -255,23 +249,13 @@ def question(self):

@abstractmethod
def gettype(self):
<<<<<<< HEAD
""" Determine the amc question type.
"""

@abstractmethod
def answers(self):
""" Create and parse answers.
"""
=======
"""Determine the amc question type."""
pass

@abstractmethod
def answers(self):
"""Create and parse answers."""
pass
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76

def transform(self, catname):
"""Main routine, applied the xml transformation."""
Expand Down Expand Up @@ -505,10 +489,6 @@ def question(self):
# call the class method and add `\QuestionIndicative`
text = super().question()
text.text = "\\QuestionIndicative\n" + text.text
<<<<<<< HEAD

=======
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76
return text


Expand Down Expand Up @@ -663,8 +643,4 @@ def CreateQuestion(qtype, question):
try:
return Q_FACTORY[qtype](question) # *args,**kwargs)
except:
<<<<<<< HEAD
raise KeyError(f" 'qtype' argument should be in {Q_FACTORY.keys()}" )
=======
raise KeyError(" 'qtype' argument should be in {}".format(Q_FACTORY.keys()))
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76
40 changes: 0 additions & 40 deletions amc2moodle/utils/calculatedParser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<<<<<<< HEAD
#!/usr/bin/env python3
=======
# -*- coding: utf-8 -*-

# This file is part of amc2moodle, a convertion tool to recast quiz written
Expand All @@ -20,7 +17,6 @@

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76
"""
# Illustration of Basic Feature of Pyparsing
Expand Down Expand Up @@ -122,13 +118,8 @@

MDL_UNSUPPORTED = {'clip'}

<<<<<<< HEAD
r''' Usefull info for pgfmathparse
http://tug.ctan.org/tex-archive/graphics/pgf/base/doc/pgfmanual.pdf p 1033
=======
# Usefull info for pgfmathparse
# http://tug.ctan.org/tex-archive/graphics/pgf/base/doc/pgfmanual.pdf p 1033
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76

# The following functions are recognized:
# abs,acos,add,and,array,asin,atan,atan2,bin,ceil,cos,
Expand Down Expand Up @@ -158,12 +149,8 @@ class CalculatedParser(ABC):
@property
@abstractmethod
def varformat(self):
<<<<<<< HEAD
"""A formater string for rendering variable in tex. Must contains {name}"""
=======
"""Format string for rendering variable in tex. Must contains {name}."""
pass
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76

def grammar(self):
"""Define the parser grammar."""
Expand Down Expand Up @@ -243,15 +230,9 @@ def variable_hook(tokens):
"""Change variable name for fp package."""
# notpossible to use '_' in tex name
out = tokens.name.replace('_', '')
<<<<<<< HEAD
if out.isalpha() == False:
Logger.warning(f" The variable '{out}' is not compatible with LaTeX naming convention. You will need to change this name in our tex file.")
return "\\" + out +' '
=======
if out.isalpha() is False:
Logger.warning(" The variable '{}' is not compatible with LaTeX naming convention. You will need to change this name in our tex file.".format(out))
return "\\" + out + ' '
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76

@staticmethod
def real_hook(tokens):
Expand Down Expand Up @@ -283,25 +264,14 @@ def atom_hook(tokens):
@staticmethod
@abstractmethod
def equation_hook(tokens):
<<<<<<< HEAD
""" Render 'equation' expression for the LaTeX target package.
"""
=======
"""Render 'equation' expression for the LaTeX target package."""
pass
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76

@staticmethod
@abstractmethod
def function_hook(tokens):
<<<<<<< HEAD
""" Modify the moodle function API to conform to the LaTeX target
package api.
"""
=======
"""Modify the moodle function API to conform to the LaTeX target package api."""
pass
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76


class CalculatedParserToFP(CalculatedParser):
Expand Down Expand Up @@ -449,12 +419,7 @@ def variable_hook(wildcards, tokens):

@staticmethod
def atom_hook(tokens):
<<<<<<< HEAD
""" Change unary minus into neg(exp) at atom level.
"""
=======
"""Change unary minus into neg(exp) at atom level."""
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76
return tokens

@staticmethod
Expand Down Expand Up @@ -550,8 +515,3 @@ def CreateCalculatedParser(ptype):
print('> amc2moodle:\n', out)

print('> wildcards set:', parser.wildcards)
<<<<<<< HEAD


=======
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76
7 changes: 0 additions & 7 deletions amc2moodle/utils/flatex.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,9 @@ def __init__(self, base_file, output_file,

@staticmethod
def is_input(line):
<<<<<<< HEAD
r"""
Determines whether or not a read in line contains an uncommented out
\input{} statement. Allows only spaces between start of line and
'\input{}'.
=======
r"""Determine if a line contains an uncommented \input{} statement.
Allows only spaces between start of line and '\input{}'.
>>>>>>> dd2442e424dbeed24b02d38b283e505615036f76
"""
# tex_input_re = r"""^\s*\\input{[^}]*}""" # input only
# match 'input' or 'include'
Expand Down

0 comments on commit c7fadf1

Please sign in to comment.